Matrix Multiplication From Scratch
Difficulty: Medium · Concept: Linear Algebra — Matrices
For an matrix and an matrix , the product is , where each entry — the dot product of 's row with 's column . This is the single operation every linear layer in a neural network runs on every forward pass.
Your task: implement matmul(A, B) for matrices represented as lists of lists of numbers (no NumPy). Raise a ValueError if the inner dimensions don't match (A's number of columns must equal B's number of rows).