One Liner Solution in Python


class Solution:
# @param A : list of integers
# @param B : list of integers
def merge(self, A, B):
#A[:]=[str(i) for i in A]


Very nice…
Unfortunately that’s might not be convincing enough for interviewers who will be expecting a more clever solution.


@rashi174 The Question clearly says solve in O(n+m) and sorting is O(nlogn). Try something clever using 2 pointers.


very nice, is python backend implement sorted by quick sort?
otherwise this solution is o(nlogn)
while the prior make it easy to solve in o(n)


What is the difference between