Merge Sorted Array
[LeetCode] Merge Sorted Array
void merge(vector& nums1, int m, vector& nums2, int n) { int idx = 0; for (int i = m; i < nums1.size(); i++) nums1[i] = nums2[idx++]; sort(nums1.begin(), nums1.end()); }
void merge(vector& nums1, int m, vector& nums2, int n) { int idx = 0; for (int i = m; i < nums1.size(); i++) nums1[i] = nums2[idx++]; sort(nums1.begin(), nums1.end()); }