Implement the upper bound binary search to find the first index where the value exceeds a target.
Constraints
Example
>>> upper_bound([1, 2, 2, 3, 4], 2) 3 >>> upper_bound([1, 2, 3], 4) 3 >>> upper_bound([5, 6], 3) 0 >>> upper_bound([], 10) 0
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints