Find 2nd largest number
Filed under Ksolves
The question
Find the second largest number in an array, returning -1 if the array has fewer than two distinct numbers.
No write-up yet. Related questions below have one.
Related Ksolves questions
Collected from public candidate posts and coding forums. Updated Nov 2026.