## Example,

Question: Return the maximum average score of students

Input: [[“ann”, 40], [“ann”, -20], [“cat”, 50], [“cat”, 60], [“tom”, 30]]

Output: 55

## Solution 1: Group all the scores of the same student in a dictionary, then run through dictionary to find the max average score

time complexiity: O(n)

space complexity: O(n)

1 | import sys |

## Solution 2: Sort the scores by name, then go through the scores again to find the maximum score

time complexiity: O(nlogn)

space complexity: O(1) because we sort in place

1 | import sys |

## Interesting,

I should learn more built in functions.