Skip to content

Commit 3d362ef

Browse files
committed
Fix
1 parent f2cf9bf commit 3d362ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/thealgorithms/divideandconquer/MedianOfTwoSortedArrays.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static double findMedianSortedArrays(int[] nums1, int[] nums2) {
3434
// Check if partition is valid
3535
if (maxLeft1 <= minRight2 && maxLeft2 <= minRight1) {
3636
// If combined array length is odd
37-
if ((m + n) % 2 == 1) {
37+
if (((m + n) & 1) == 1) {
3838
return Math.max(maxLeft1, maxLeft2);
3939
}
4040
// If combined array length is even

0 commit comments

Comments
 (0)