Find the Runner-Up Score!

  • + 1 comment

    You can use sort() it is efficient than sorted() as it does in-place sorting. They used sorted, so that they write it in lesser number of characters.

    sort() returns None whereas sorted() returns the newly created list.

    Using sort() :

    n=input()
    nums=set(map(int),input().split())
    nums.sort() #here in-place sorting takes place
    print (nums[-2])