Merge Sorted Array
Try to solve the Merge Sorted Array problem.
We'll cover the following
Statement
Given two sorted integer arrays, and , and the number of data elements in each array, and , implement a function that merges the second array into the first one. You have to modify in place.
Note: Assume that has a size equal to , meaning it has enough space to hold additional elements from .
Constraints:
nums1.length
nums2.length
-
nums1[i]
,nums2[j]
Example
The inputs will be two integer arrays and two integers representing the number of data elements in each array.
Create a free account to view this lesson.
By signing up, you agree to Educative's Terms of Service and Privacy Policy