#C13620. Second Largest Unique Element
Second Largest Unique Element
Second Largest Unique Element
Given a list of integers, determine the second largest unique element. That is, if we let \( U \) be the set of unique elements from the provided list, your task is to output the second largest element in \( U \). If \( U \) contains fewer than two elements, output None
.
Note: The input is provided via standard input (stdin) and the result should be printed to standard output (stdout).
inputFormat
The first line of input contains an integer \( n \) (\(1 \leq n \leq 10^5\)) representing the number of elements. The second line contains \( n \) space-separated integers.
outputFormat
Output the second largest unique element. If such an element does not exist, output None
.
6
4 3 1 4 5 3
4