Loading...
Loading...
Loading...
Print the second highest distinct score. Scores that equal the highest do not count as the second. The list always has at least two different scores.
Example
Input
6 12 35 1 10 34 1
Output
34
35 is the highest, 34 the second.
Try the problem first. Open one hint at a time.
Track two values while going through the list: the highest so far and the best score below it.
Ignore a score equal to the highest, so repeats do not become the second.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor