Problem

In an array with at least two elements, return the smallest value that is larger than the minimum.

Examples

  • secondSmallest([5, 2, 8, 2]) -> 5
  • secondSmallest([10, 20]) -> 20
  • secondSmallest([3, 1, 4, 1]) -> 3
Compile and test (Ctrl+Enter)