Function to find if the grid can be made alternating
public static void findPossibleGrid ( int n , int m , char [ , ] a ) { bool flag = true ; int k = - 1 , o = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) { if ( a [ i , j ] != ' * ' ) {