Given two integer arrays nums1 and nums2, both sorted in non-decreasing order, merge them into a single sorted array and return it.
The merged array should also be in non-decreasing order.
Input: Two sorted integer arrays nums1 and nums2.
Output: A single sorted merged array containing all elements from both arrays.
Input: [1,2,3],[2,5,6]
Output: [1,2,2,3,5,6]
Explanation: Two pointers: pick 1(i), 2(j), 2(i), 3(i), 5(j), 6(j) → [1,2,2,3,5,6].Input: [1,3,5],[2,4,6]
Output: [1,2,3,4,5,6]
Explanation: Alternately pick from both arrays: 1,2,3,4,5,6.Input: [],[]
Output: []
Explanation: Both empty. Return [].0 <= nums1.length, nums2.length <= 10^4-10^9 <= nums1[i], nums2[i] <= 10^9