Loading...
Loading...
You are given three matrices a, b and c as 2D integer arrays. a has n rows and m columns, b has m rows and p columns, and c has p rows and q columns, so a * b * c has n rows and q columns.
Here a * b * c denotes standard matrix multiplication: the entry at row i and column j of a * b * c is the sum of a[i][k] * b[k][l] * c[l][j] over every k from 0 to m - 1 and every l from 0 to p - 1.
Return a * b * c as a 2D integer array.
a has n rows and m columns, b has m rows and p columns, and c has p rows and q columns.a[i][j] ≤10, −10≤ b[i][j] ≤10 and −10≤ c[i][j] ≤10All three matrices are 1 by 1, so the product is the single number 2 * 3 * 4 = 24.
The shapes are 1 by 2, 2 by 2 and 2 by 1, so the product is a 1 by 1 matrix whose only entry is 219.
The first matrix is the 2 by 2 identity, so the product is b * c, which works out to [[5], [9]].