Find the Runner-Up Score!

  • + 2 comments

    List isn't necessary as sorted takes any object iirc

    print raw_input()==0 or sorted(set(map(int, raw_input().split())))[-2]
    

    For those that didn't understand, first input isn't actually necessary because validation of the length of the numbers entered in 2nd line isn't actually being asked

    raw_input returns type string, hence it will never be zero(0) and won't print the first input under any circumstance.

    Next read the input,split away the spaces and map it to integer type

    Make it's set

    Sort the set

    Print the 2nd last element in the sorted set