Find the Runner-Up Score - Solution of HackerRank Python

Author: Al-mamun Sarkar Date: 2020-03-23 16:10:51

Find the Runner-Up Score - Solution of HackerRank Python Basic Data Types.

Code:

if __name__ == '__main__':
    n = int(input())
    arr = set(map(int, input().split()))
    arr = sorted(arr, key=int, reverse=True)
    arr.pop(0)
    print(arr.pop(0))

Example Input:

5
2 3 6 6 5

Output:

5