Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f079c78

Browse files
committedMay 7, 2022
Time: 79 ms (50.48%), Space: 42.1 MB (58.16%) - LeetHub
1 parent 5efdff8 commit f079c78

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
 
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* @param {number[]} nums1
3+
* @param {number} m
4+
* @param {number[]} nums2
5+
* @param {number} n
6+
* @return {void} Do not return anything, modify nums1 in-place instead.
7+
*/
8+
var merge = function(nums1, m, nums2, n) {
9+
let i = m;
10+
let j = 0;
11+
while(j<n){
12+
nums1[i]=nums2[j]
13+
i++;
14+
j++;
15+
}
16+
17+
18+
nums1.sort((a,b)=>a-b)
19+
};

0 commit comments

Comments
 (0)
Please sign in to comment.