QuestionYou are given two integer arraysnums1andnums2, sorted innon-decreasing order, and two integersmandn, representing the number of elements innums1andnums2respectively.Mergenums1andnums2into a single array sorted innon-decreasing order.The final sorted array should not be returned by the function, but instead bestored inside the arraynums1. To accommodate this,nums1has a length ofm + n, where the firstmelements denote the elements that should be merged, and the lastnelements are set to0and should be ignored.nums2has a length ofn.Example 1:Input: nums1 = [1,2,3,0,0,0], m = 3, nums2 = [2,5,
...
继续阅读
(43)