#C12163. Second Largest Element in a List
Second Largest Element in a List
Second Largest Element in a List
You are given a list of integers. Your task is to find the second largest distinct number in the list. If the list contains fewer than two distinct numbers, output None.
Formally, let \( S \) be the set of distinct integers in the list. If \(|S| \ge 2\), output the second largest element in \( S \); otherwise, output \(None\).
inputFormat
The input is read from standard input (stdin) and consists of two lines:
- The first line contains an integer \( n \) representing the number of elements in the list.
- The second line contains \( n \) space-separated integers.
outputFormat
Output the second largest distinct number in the list on a single line. If no such number exists, print None.
## sample5
10 4 3 2 10
4
</p>