Minesweeper Solver

#include
using namespace std;
  

int N, M;
  

#define MAXM 100
#define MAXN 100
  

int dx[9] = { -1, 0, 1, -1, 0, 1, -1, 0, 1 };
int dy[9] = { 0, 0, 0, -1, -1, -1, 1, 1, 1 };
  

bool isValid(int x, int y)
{
    return (x >= 0 && y >= 0
            && x < N && y < M); }    void printGrid(bool grid[MAXN][MAXM]) {     for (int row = 0; row < N; row++) {         for (int col = 0; col < M; col++) {             if (grid[row][col])                 cout