...

/

Solution: Merge Sorted Array

Solution: Merge Sorted Array

Let's solve the Merge Sorted Array problem using the K-way Merge pattern.

Statement

Given two sorted integer arrays, nums1nums1 and nums2nums2, and the number of data elements in each array, mm and nn, implement a function that merges the second array into the first one. You have to modify nums1nums1 in place.

Note: Assume that nums1nums1 has a size equal to m+nm + n, meaning it has enough space to hold additional elements from nums2nums2.

Constraints:

  • nums1.length
...