Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find the Runner-Up Score >> Explanation

Tags:

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

Input Format

The first line contains N. The second line contains an array of N integers each separated by a space.

I found this solution

n = int(input())

nums = map(int, input().split())    
print(sorted(list(set(nums)))[-2])

can someone explain me why we are using map function here ?

Also if someone can explain me this line :

nums = map(int, input().split())