scores is sorted in non-decreasing order, and equal values may repeat. Find where the value wanted sits: return [first position, last position] (0-based).
If the value is not there, return [-1, -1].
The list can be very long, so your solution must run in O(log n).scores=[2, 4, 4, 4, 9, 11], wanted=4 → [1, 3]
The 4s occupy positions 1 through 3.
scores=[-3, 0, 6], wanted=5 → [-1, -1]
There is no 5 in the list.
scores=[7], wanted=7 → [0, 0]
scores is sorted in non-decreasing orderscores=[2, 4, 4, 4, 9, 11], wanted=4
[1, 3]
Run checks the first 3 tests in your browser. Submit checks all 140 tests on the server, hidden ones included.