관리 메뉴

기억을 위한 기록들

[HackerRank Python] Find the Runner-Up Score! - 본문

Coding Test - Python

[HackerRank Python] Find the Runner-Up Score! -

에드윈H 2021. 10. 10. 17:09

https://www.hackerrank.com/challenges/find-second-maximum-number-in-a-list/problem?isFullScreen=true 

 

Find the Runner-Up Score! | HackerRank

For a given list of numbers, find the second largest number.

www.hackerrank.com

 

 

 

if __name__ == '__main__':
    n = int(input())
    arr = map(int, input().split())     
    
    sortedArr = sorted(set(arr))
    print(sortedArr[-2])