Skip to content

Commit c8bab73

Browse files
authored
Merge pull request #3184 from noelbautista91/main
Prevent integer overflow in 0153-find-minimum-in-rotated-sorted-array.py
2 parents 8daca7d + 4bb44a2 commit c8bab73

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/0153-find-minimum-in-rotated-sorted-array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ def findMin(self, nums: List[int]) -> int:
44
curr_min = float("inf")
55

66
while start < end :
7-
mid = (start + end ) // 2
7+
mid = start + (end - start ) // 2
88
curr_min = min(curr_min,nums[mid])
99

1010
# right has the min

0 commit comments

Comments
 (0)