Loading...
Loading...
Loading...
A sorted list holds stock levels, and the same level can appear many times. Read a level x and print how many times it appears.
Example
Input
6 5 10 10 10 20 30 10
Output
3
Try the problem first. Open one hint at a time.
Count equals the upper bound minus the lower bound of x.
bisect_left and bisect_right give those two positions.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor