Utility function to print the contents of a 2 - D array
function printMatrix ( sol , N ) { for ( var i = 0 ; i < N ; i ++ ) { for ( var j = 0 ; j < N ; j ++ ) document . write ( sol [ i ] [ j ] + " " ) ; document . write ( " " ) ; } }