Skip to content

Commit f0eece1

Browse files
Create Merge two sorted array-89
1 parent 351a222 commit f0eece1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Merge two sorted array-89

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
public void merge(int[] nums1, int m, int[] nums2, int n) {
2+
for (int i = 0; i < n; i++) {
3+
nums1[i + m] = nums2[i];
4+
}
5+
Arrays.sort(nums1);
6+
}

0 commit comments

Comments
 (0)