Question
A gradebook logs retakes as rows "student,subject,score" (score a non-negative integer); the same student-subject pair can appear several times. Produce the flattened grade matrix the report card reads: a dictionary keyed by "student.subject" (the two fields joined with a dot) whose value is that pair's HIGHEST score. Example: ["ava,math,80", "ava,math,92", "raj,art,75"] gives {"ava.math": 92, "raj.art": 75}.
grade_matrix(rows: list[str]) → dict[str,int][["ava,math,80","ava,math,92","raj,art,75"]]out{"raj.art":75,"ava.math":92}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.
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.