auto commit

This commit is contained in:
CyC2018 2021-04-19 01:03:52 +08:00
parent 01f9a926dc
commit f6c2333822

View File

@ -209,7 +209,7 @@ Output: [1,2,2,3,5,6]
public void merge(int[] nums1, int m, int[] nums2, int n) {
int index1 = m - 1, index2 = n - 1;
int indexMerge = m + n - 1;
while (index1 >= 0 || index2 >= 0) {
while (index2 >= 0) {
if (index1 < 0) {
nums1[indexMerge--] = nums2[index2--];
} else if (index2 < 0) {