Skip to content

Commit 60065ec

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent e3cea9b commit 60065ec

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

divide_and_conquer/median_of_two_sorted_arrays.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ def find_median_sorted_arrays(nums1: List[int], nums2: List[int]) -> float:
5656
j = (m + n + 1) // 2 - i # Partition in nums2
5757

5858
# Edge cases for partitions
59-
left1 = float('-inf') if i == 0 else nums1[i - 1]
60-
right1 = float('inf') if i == m else nums1[i]
61-
left2 = float('-inf') if j == 0 else nums2[j - 1]
62-
right2 = float('inf') if j == n else nums2[j]
59+
left1 = float("-inf") if i == 0 else nums1[i - 1]
60+
right1 = float("inf") if i == m else nums1[i]
61+
left2 = float("-inf") if j == 0 else nums2[j - 1]
62+
right2 = float("inf") if j == n else nums2[j]
6363

6464
# Check if this partition is correct
6565
if left1 <= right2 and left2 <= right1:
@@ -85,4 +85,4 @@ def find_median_sorted_arrays(nums1: List[int], nums2: List[int]) -> float:
8585
if __name__ == "__main__":
8686
assert abs(find_median_sorted_arrays([1, 3], [2]) - 2.0) < 1e-5
8787
assert abs(find_median_sorted_arrays([1, 2], [3, 4]) - 2.5) < 1e-5
88-
print("All tests passed!")
88+
print("All tests passed!")

0 commit comments

Comments
 (0)