Find the Runner-Up Score!

  • + 0 comments

    It's because your not transfer your array to list. For have chance reuse array with map function we must transfer it to list:

    if name == 'main': n = int(input()) arr = list(map(int, input().split())) first = 0 second = 0

    for i in arr:
        if i > first:
            first = i
    
    for j in arr:
        if j == first:
            continue
        elif j > second:
            second = j
    
    print(second)