Function to print valid matrix
public static void printMatrix ( char [ , ] arr , int n , int m ) { place ( arr , n , m ) ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) { Console . Write ( arr [ i , j ] ) ; } Console . WriteLine ( ) ; } }