Loading...
Loading...
Loading...
A teacher wants the second highest distinct mark in a class. Equal marks count once, so in 9 9 4 the second highest is 4. If there is no second distinct mark, print NONE.
Example
Input
5 72 95 88 95 60
Output
88
Distinct marks: 95, 88, 72, 60. The second largest is 88.
Try the problem first. Open one hint at a time.
Remove repeated marks first. A set does that.
After sorting the distinct marks, check how many there are before you read the second last.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor