← 返回 goldmansachs 的题目列表Highest Average Score
类型:online_judge
Given a record of student scores, find the highest average score for each student.
Input is a list of records, where each record contains a student's name and an exam score. The goal is to output the highest average score for each student.
Example
Input:
[['John', 85], ['John', 90], ['John', 78], ['Jane', 93], ['Jane', 88], ['Jane', 92]]
Output:
{'John': 84.33, 'Jane': 91}
Note
Each student has at least one record.
Scores are given as integers, output the average with two decimal places.
Example
Input
[['John', 85], ['John', 90], ['John', 78], ['Jane', 93], ['Jane', 88], ['Jane', 92]]