Question
Your team ships a spam filter and the eval dashboard needs the four confusion-matrix cells. Given two equal-length lists of binary labels, y_true and y_pred (1 = spam, 0 = not spam), return the list [tp, fp, fn, tn] where tp counts pairs with true 1 and predicted 1, fp counts true 0 predicted 1, fn counts true 1 predicted 0, and tn counts true 0 predicted 0. Example: y_true = [1, 0, 1, 1, 0], y_pred = [1, 1, 0, 1, 0] gives [2, 1, 1, 1].
confusion_cells(y_true: list[int], y_pred: list[int]) → list[int][[1,0,1,1,0],[1,1,0,1,0]]out[2,1,1,1]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.