Runner-Up (Arrays & Lists)

Read n integers and print the second-largest distinct value, or none if there isn’t one.

Input: n, then n integers.

Output: A number or none.

Difficulty: Easy. Write your answer in the browser editor, run the examples, then submit it against hidden tests. Python and JavaScript are free; other languages are part of licode Club.

Hint

  • Track the best and second best as you go.

More Arrays & Lists practice