Function to print the grid , if possible
public static void printGrid ( char [ , ] grid , int N , int M ) { for ( int i = 0 ; i < N ; i ++ ) { for ( int j = 0 ; j < M ; j ++ ) { Console . Write ( grid [ i , j ] + " ▁ " ) ; } Console . WriteLine ( ) ; } }