Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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‎

Lines changed: 1 addition & 1 deletion
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)

AltStyle によって変換されたページ (->オリジナル) /