Hacky JavaScript Solution


  • 0
    M
    var merge = function(nums1, m, nums2, n) {
        for (let i = m; i < nums1.length; i++) {
            nums1[i] = nums2.shift();
        }
        nums1.sort((a,b) => a-b);
    };
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.