Second largest - MarisaOJ: Marisa Online Judge

Second largest

Time limit: 1000 ms
Memory limit: 256 MB
You are given an array $A$ contains unique integer of length $n$. Find the second largest value in $A$. ### Input - The first line contains an integer $n$. - The second line contains $n$ integers $A_i$. ### Output - Print a single integer, the second largest value. ### Constraints - $2 \le n \le 10^5$. - $|A_i| \le 10^5 $. ### Example Input: ``` 4 4 3 2 1 ``` Output: ``` 3 ```