second_largest(numbers) that returns the second largest distinct value in numbers without using sorted() or .sort(). Scan the list in a single pass. If fewer than 2 distinct values exist, return None.numbers = [4, 1, 7, 7, 3]
4
Largest is 7 (even though it repeats); the next distinct value down is 4.
numbers = [5, 5, 5]
None
Only one distinct value exists.
Track "largest" and "second" while scanning; update both carefully, skipping values equal to the current largest.