Advertisement
AyanUpadhaya

Find The Second Highest Score Problem Solving | HackerRank

Nov 7th, 2021
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. if __name__ == '__main__':
  2.     score_list = []
  3.     for i in range(int(raw_input())):
  4.         name = raw_input()
  5.         score = float(raw_input())
  6.         score_list.append([name,score])
  7.        
  8.     second_highest = sorted(set([score for name,score in score_list]))[1]
  9.    
  10.     print("\n".join(sorted(set([name for name, score in score_list if score==second_highest]))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement