Skip to content

Commit 71e008c

Browse files
update solution 0004 [java], fix bug, exchange i and j
1 parent e8988f6 commit 71e008c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

solution/0004.Median of Two Sorted Arrays/Solution.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public double findMedianSortedArrays(int[] nums1, int[] nums2) {
3333
return maxLeft;
3434
}
3535

36-
int minRight = i == len1 ? nums2[j] : j == len2 ? nums1[i] : Math.min(nums2[i], nums1[j]);
36+
int minRight = i == len1 ? nums2[j] : j == len2 ? nums1[i] : Math.min(nums2[j], nums1[i]);
3737

3838
return (maxLeft + minRight) / 2.0;
3939

0 commit comments

Comments
 (0)