Second Smallest

Easy · rating 1000 · Arrays

The first line has n. The second line has n integers with at least two distinct values. Print the second smallest distinct value.

Constraints: 2 ≤ n ≤ 105

Related problems

Open Second Smallest in Code Arena →