/** * * @param A int整型一维数组 * @param B int整型一维数组 * @return void */ function merge( A, m, B, n ) { // write code here let i = m-1 let j = n-1 let k = m+n-1 while(i>=0 && j>=0){ if(A[i]>=B[j]){ A[k] = A[i] i-- }else{ A[k] = B[j] j-- } k-- } while(j>=0){ A[k] = B[j] j-- k-- } } module.exports = { merge : merge };