The answer is wrong for the website,it is right in my local evironment


  • 0
    W
    var merge = function(nums1, m, nums2, n) {
        var min = Math.min(m,n);
        for(var i = 0;i<min;i++){
            if(nums1[i]>nums2[i])
                nums1.splice(i,0,nums2[i]);
        }
        if(min === m){
            nums1.concat(nums2.slice(min));
        }
    }

Log in to reply
 

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