Create an auxiliary matrix to store elements of the multiplication matrix
let temp = new Array ( K + 1 ) ; for ( let i = 0 ; i <= K ; i ++ ) { temp [ i ] = new Array ( K + 1 ) ; for ( let j = 0 ; j <= K ; j ++ ) { temp [ i ] [ j ] = 0 ; } }