Judie 发表于 2021-3-28 12:58:11

【朱迪的LeetCode刷题笔记】88. Merge Sorted Array #Easy #C

本帖最后由 Judie 于 2021-4-6 14:22 编辑


88. Merge Sorted Array #Easy

Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.

The number of elements initialized in nums1 and nums2 are m and n respectively. You may assume that nums1 has a size equal to m + n such that it has enough space to hold additional elements from nums2.


Example 1:

Input: nums1 = , m = 3, nums2 = , n = 3
Output:

Example 2:

Input: nums1 = , m = 1, nums2 = [], n = 0
Output:


Constraints:

nums1.length == m + n
nums2.length == n
0 <= m, n <= 200
1 <= m + n <= 200
-109 <= nums1, nums2 <= 109



页: [1]
查看完整版本: 【朱迪的LeetCode刷题笔记】88. Merge Sorted Array #Easy #C