leetle

Daily challenge for 2025-07-03

184. Find Second Smallest Number

Write a function solve that takes a list of integers and returns the second smallest number. If there are duplicate smallest numbers, still return the second distinct smallest number. If there is no second smallest number, return -1.

Example:
Input: [4, 1, 3, 2, 5]
Output: 2

The smallest is 1, and the second smallest is 2.

Run this challenge interactively in Python or JavaScript when the app loads.