6 lines
205 B
Text
6 lines
205 B
Text
fcn matMult(a,b){
|
|
n,m,p:=a[0].len(),a.len(),b[0].len();
|
|
ans:=(0).pump(m,List().write, (0).pump(p,List,0).copy); // matrix of zeros
|
|
foreach i,j,k in (m,p,n){ ans[i][j]+=a[i][k]*b[k][j]; }
|
|
ans
|
|
}
|