class Solution {
public:
void merge(int A[], int m, int B[], int n) {
int i = m1;
int j = n1;
for (int k = m+n1; k >= 0; k) {
if (i < 0) A[k] = B[j];
else if (j < 0) A[k] = A[i];
else if (A[i] < B[j]) A[k] = B[j];
else A[k] = A[i];
}
}
};
Cleanest Solution

if A={1,2,3,,},B={4},we get m=3,n=1. so k start at m+n1=3.it seems like A would end up with A={1,2,3,4}. am I wrong?