Utility function for matrix multiplication
function multiply ( A , B , C ) { for ( let i = 0 ; i < V ; i ++ ) { for ( let j = 0 ; j < V ; j ++ ) { C [ i ] [ j ] = 0 ; for ( let k = 0 ; k < V ; k ++ ) C [ i ] [ j ] += A [ i ] [ k ] * B [ k ] [ j ] ; } } }