Question
Implement matrix-vector multiplication from scratch. Given a matrix as a list of rows (each row a list of numbers, all rows the same length) and a vector whose length equals the number of columns, return the result vector: each output entry is the dot product of the corresponding matrix row with the vector. The matrix has at least one row. Return integer values where exact (do not round).
matvec(matrix: list[list[float]], vec: list[float]) → list[float][[[1,0],[0,1]],[5,7]]out[5,7]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.