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())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With