Merge Sorted Array - LeetCode

PHOTO EMBED

Fri Nov 22 2024 19:55:37 GMT+0000 (Coordinated Universal Time)

Saved by @prashant

Input: nums1 = [1,2,3,0,0,0], m = 3, nums2 = [2,5,6], n = 3
Output: [1,2,2,3,5,6]
Explanation: The arrays we are merging are [1,2,3] and [2,5,6].
The result of the merge is [1,2,2,3,5,6] with the underlined elements coming from nums1.
content_copyCOPY

https://leetcode.com/problems/merge-sorted-array/description/