FunctionRacerProblemsRace

Second Largest

EasyNumPyPython

Return the second largest number in nums, counting repeats as separate numbers. So in [9, 9, 4] the second largest is 9, and in [5, 3, 3] it is 3. As an int.

Example 1

nums [5,8,2,7]
returns 7

Sorted from largest: 8, 7, 5, 2. The second is 7.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More NumPy problems