here is my 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 < m and n > 0:
if A[i]<B[j]:
while i < m and A[i] < B[j]:
i+=1
A.insert(i, B.pop(j))
n-=1
m+=1
else:
while n > 0 and A[i] >= B[j]:
A.insert(i, B.pop(j))
n-=1
m+=1
while len(B) > 0:
*A.insert( m + n - len(B) , B.pop(0))* # changed from A.append(B.pop(0))
return
if __name__ == '__main__':
s = Solution()
A,B = [], [1]
s.merge(A,len(A),B,len(B))
print A
```

i submit my code to OJ, but here are results:

```
Submission Result: Wrong Answer
Input: [], [1]
Output: [0]
Expected: [1]
```

i can't figure out why my code output [0] at this situation.

So, could anyone point out my error in code, MANY THX.