My output is always , even if my function return .
# @param A a list of integers
# @param m an integer, length of A
# @param B a list of integers
# @param n an integer, length of B
# @return nothing
def merge(self, A, m, B, n):
With this problem, there is no return.
What you need to do is put the sorted array into A, which already has enough room for all the elements in A and B together.
The reason it is saying your output is  is because that is the contents of array A at the end of your method. A=, with n 0s added to the end to provide space for B, resulting in + = . As it believes there is no return, it looks at A when the function ends and compares it to the expected value.