We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a07a75d commit 3a2e0c9Copy full SHA for 3a2e0c9
LeetCode/88. Merge Sorted Array/index.js
@@ -0,0 +1,25 @@
1
+var merge = function(nums1, m, nums2, n) {
2
+ let first = 0, second = 0;
3
+ let tmp = [];
4
+ while (first < m || second < n) {
5
+ if (nums1[first] <= nums2[second]) {
6
+ tmp.push(nums1[first]);
7
+ first++;
8
+ } else {
9
+ tmp.push(nums2[second]);
10
+ second++;
11
+ }
12
13
+ while (first < m) {
14
15
16
17
+ while (second < n) {
18
19
20
21
+
22
+ return tmp;
23
+};
24
25
+console.log(merge([]))
0 commit comments