Average quiz scores
A gradebook export lists one quiz result per row as "student,score", where score is a non-negative integer; a student may appear on several rows. Return a dictionary mapping each student to the floor of their average score. For example, ["mia,90", "mia,95", "leo,80"] gives {"mia": 92, "leo": 80} because floor(185/2) = 92.
Implement
average_score(rows: list[str]) → dict[str,int]Examples
in
[["mia,90","mia,95","leo,80"]]out{"leo":80,"mia":92}What a strong answer looks like
State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
0:00 of about 12 min
solution.py
InputExpectedGot
[["mia,90","mia,95","leo,80"]]{"leo":80,"mia":92}not run yetsample