Useless c++ solution


  • 0
    W
    void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) {
        for (int i = (m--)+(n--)-1; i >= 0; i--) n >= 0 && (m < 0 || nums2[n] > nums1[m]) ? nums1[i] = nums2[n--] : nums1[i] = nums1[m--];
    }

Log in to reply
 

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