Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- l = 0
- r = n - 1
- while r - l > 1:
- m = (l + r) // 2
- if a[m] == 1:
- r = m
- else:
- l = m
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement