Find the Runner-Up Score - Solution of HackerRank Python

Find the Runner-Up Score - Solution of HackerRank Python

Instructor-svgAl-Mamun Sarkar
Mar 23 , 2020

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
  • Share On:
  • fb
  • twitter
  • pinterest
  • instagram