#C7692. Second Highest Score
Second Highest Score
Second Highest Score
You are given an integer \( n \) representing the number of scores, followed by a list of \( n \) integers. Your task is to find the second highest unique score among them. If there is no second highest score (i.e. when all scores are identical), output None
.
Note: The scores can be very large (up to \(10^9\)), and there might be duplicate values. Ensure that you use efficient methods to avoid performance issues.
inputFormat
The input is read from stdin and is in the following format:
- The first line contains an integer \( n \), the number of scores.
- The second line contains \( n \) space-separated integers representing the scores.
outputFormat
Output the second highest unique score to stdout. If there is no second highest unique score, output None
.
5
40 75 40 20 100
75