Created
June 6, 2022 14:45
-
-
Save mym0404/a1e8aae7b4ba149b505b6e5cc928846b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bisect import bisect_left | |
arr = [1, 2, 3, 3, 5, 6, 6, 8, 9, 10] | |
left, right = 0, 9 | |
target = 8 | |
answer = bisect_left(arr, target, lo=left, hi=right) | |
print(answer) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment