Skip to content

Commit cdfc802

Browse files
committed
Update search-for-a-range.py
1 parent 5ef7272 commit cdfc802

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Python/search-for-a-range.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ class Solution:
1717
# @param target, an integer to be searched
1818
# @return a list of length 2, [index1, index2]
1919
def searchRange(self, A, target):
20+
# This is main For binarySearch3()
21+
A += [float("inf")]
22+
2023
# Find the first index where target <= A[idx]
2124
left = self.binarySearch(lambda x, y: x <= y, A, target)
2225
if left >= len(A) or A[left] != target:

0 commit comments

Comments
 (0)