I got accepted using following code:

```
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):
i=0
j=0
while i<len(A) and j<n:
if A[i]>=B[j]:
A.insert(i,B[j])
j+=1
i+=1
while j<n:
A.insert(m+j,B[j])
j+=1
```

But I got wrong answer using following code on the input: [], [1]:

```
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):
i=0
j=0
while i<len(A) and j<n:
if A[i]>=B[j]:
A.insert(i,B[j])
j+=1
i+=1
while j<n:
A.append(B[j])
j+=1
```

or:

```
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):
i=0
j=0
while i<len(A) and j<n:
if A[i]>=B[j]:
A.insert(i,B[j])
j+=1
i+=1
while j<n:
A.insert(len(A),B[j])
j+=1
```

or:

```
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):
i=0
j=0
while i<len(A) and j<n:
if A[i]>=B[j]:
A.insert(i,B[j])
j+=1
i+=1
A+=B[j:]
```

It says my output is [0], however, the expected output is [1], which is the same as what I get on my computer. Just can not figure out the reason. Could anyone help me? Thank you!