text: Maximum determinant of a matrix with every values either 0 or n | Function for maximum determinant ; Function to print resulatant matrix ; three position where 0 appears ; position where n appears ; Driver code
code: < ? php function maxDet ( $ n ) { return ( 2 * $ n * $ n * $ n ) ; } function resMatrix ( $ n ) { for ( $ i = 0 ; $ i < 3 ; $ i ++ ) { for ( $ j = 0 ; $ j < 3 ; $ j ++ ) { if ( $ i == 0 && $ j == 2 ) echo "0 ▁ " ; else if ( $ i == 1 && $ j == 0 ) echo "0 ▁ " ; else if ( $ i == 2 && $ j == 1 ) echo "0 ▁ " ; else echo $ n , " ▁ " ; } echo " STRNEWLINE " ; } } $ n = 15 ; echo " Maximum ▁ Determinant ▁ = ▁ " , maxDet ( $ n ) ; echo " Resultant Matrix : " resMatrix ( $ n ) ; ? >