Find determinant of matrix generated by array rotation | Java script program for finding determinant of generated matrix ; Function to calculate determinant ; Driver code
let N = 3 ; function calcDeterminant ( arr ) { let determinant = 0 ; for ( let i = 0 ; i < N ; i ++ ) { determinant += Math . pow ( arr [ i ] , 3 ) ; } determinant -= 3 * arr [ 0 ] * arr [ 1 ] * arr [ 2 ] ; return determinant ; } let arr = [ 4 , 5 , 3 ] ; document . write ( calcDeterminant ( arr ) ) ;