HackerRank- Python Find the Runner-Up Score!

Given the participants' score sheet for your University Sports Day, you are required to find the runner-up score. You are given N scores. Store them in a list and find the score of the runner-up.

  1. if __name__ == '__main__':
  2. n = int(input())
  3. arr = list(map(int, input().split()))
  4. zes = max(arr)
  5. i=0
  6. while(i<n):
  7. if zes ==max(arr):
  8. arr.remove(max(arr))
  9. i+=1
  10. print(max(arr))

download android app