NumPy allowed · plain Python earns 15 bonus points
Implement 2D matrix multiplication using dot products of rows and columns, laying the foundation for dense neural network layers.
Implement matmul(A, B) for 2D matrices represented as nested lists. Raise ValueError if inner dimensions do not match.
matmul(A: list[list[float]], B: list[list[float]]) -> list[list[float]]