#C13996. Second Largest Element

    ID: 43595 Type: Default 1000ms 256MiB

Second Largest Element

Second Largest Element

Given an array of integers, your task is to find the second largest distinct element. If the array does not contain at least two distinct numbers, output (\text{None}).

The input is provided via standard input. The first line contains an integer (n), which is the number of elements in the array. The second line contains (n) space-separated integers.

Output the second largest distinct integer. If such an element does not exist, print (\text{None}).

inputFormat

The first line contains a single integer (n) ((0 \leq n \leq 10^5)), indicating the number of elements in the array. The second line contains (n) space-separated integers.

outputFormat

Output the second largest distinct integer in the array. If no such element exists, output (\text{None}).## sample

5
1 2 3 4 5
4