```
class Solution:
# @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):
result = list()
i,j = 0,0
while i < m and j < n:
if i < m and j < n:
if A[i] <= B[j]:
result.append(A[i])
i = i + 1
else:
result.append(B[j])
j = j + 1
result.extend(A[i:])
result.extend(B[j:])
A = result
```