First and second place

Write code · Medium · §3.1 Finding ranks

You are given a list of student names names and a list of scores scores. The score of student names[i] is scores[i].

Complete the function solution, which returns a list of the names of the first-place and second-place students, in that order. No two scores are the same.

Function

solution(names, scores)

Constraints

Examples

namesscoresresult
['Minjun', 'Seoyeon', 'Jiho'][70, 95, 88]['Seoyeon', 'Jiho']
['a', 'b'][1, 2]['b', 'a']

Starter code

def solution(names, scores):
    answer = []
    return answer

Solve this problem in your browser

Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.