left of size m×k and right of size k×n. Most of their entries are zero. Return the product left · right: an m×n matrix whose entry in row i and column j is the sum of left[i][t] · right[t][j] over all t.
The sizes are guaranteed to match. Try not to waste time multiplying by zero.left=[[0, 2, 0], [0, 0, -1]], right=[[5, 0], [0, 3], [4, 0]] → [[0, 6], [-4, 0]]
Row [0, 2, 0] gives 2 · [0, 3] = [0, 6], and row [0, 0, -1] gives -1 · [4, 0] = [-4, 0].
left=[[3]], right=[[0, -2, 7]] → [[0, -6, 21]]
A 1×1 matrix times a row: every entry is multiplied by 3.
left[i][j], right[i][j] ≤ 100left=[[0, 2, 0], [0, 0, -1]], right=[[5, 0], [0, 3], [4, 0]]
[[0, 6], [-4, 0]]
Run checks the first 3 tests in your browser. Submit checks all 87 tests on the server, hidden ones included.