#146EasyLists & Tuples· Traversal
Second Largest Value
Input format
`numbers`: a list of integers.
Output format
An integer, or `null` when there is no second largest distinct value.
Examples
Input: numbers = [4,9,2,9,7]
Output: 7
9 is the largest; the duplicate 9 does not count again, so the answer is 7.
Input: numbers = [5,5,5]
Output: null
There is only one distinct value.
Constraints
- 0 <= len(numbers) <= 10^5
- -10^9 <= value <= 10^9
Study first
- #python
- #lists
- #loops
- #edge-cases
