Loading...
Loading...
Loading...
A sorted list holds order amounts. For a range low..high (both included) print how many amounts fall inside it.
Example
Input
7 40 120 120 250 400 650 900 120 650
Output
5
Try the problem first. Open one hint at a time.
Count the amounts that are at most high, then take away those below low.
Use bisect_right for the first count and bisect_left for the second.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor