← Problems3. Matrix Multiply
EasyMatricesLinear AlgebraNumPy
Implement matrix multiplication for two 2D matrices A and B.
Given A∈Rm×k and B∈Rk×n, compute:
Cij=∑l=1kAil⋅Blj
The result C has shape m×n.
Example
A = [[1, 2], B = [[5, 6],
[3, 4]] [7, 8]]
Output: [[19, 22],
[43, 50]]
Constraints
- Inputs are given as lists of lists (not NumPy arrays), but you may convert internally.
- You may assume the dimensions are compatible for multiplication.