Loading...
Loading...
Loading...
Exam marks are whole numbers from 0 to 1000. For each student, print how many students scored strictly lower. The students are listed in input order.
Example 1
Input
8 1 2 2 3
Output
4 0 1 1 3
Example 2
Input
5 5
Output
0 0
Try the problem first. Open one hint at a time.
The range is small, so counting works better than sorting.
A running total of the counts gives the number of lower marks.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor