Second Largest
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
2 <= len(nums) <= 100
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More NumPy problems
- Smallest PositiveEasy
- Softmax WeightsEasy
- Sort Each RowEasy
- Strong RowsEasy
- Total Over LimitEasy
- Trend SlopeEasy
- Trimmed MeanEasy
- Vector DistanceEasy