Devising a Plan: Strategy

Develop a strategy to solve this problem.

We'll cover the following

Strategy

Now, we know the basics of the game. We’ve gathered all the information from the problem statement and need to come up with a strategy to achieve win the game…but we don’t know how to do that. Let’s ask ourselves the following questions:

  • Do we have to be specific while guessing the mine?

  • Should our guesses about which cells are mines be precise?

  • Can we use the information we have in a logical manner to find the mines?

We can divide our problem into multiple subproblems and solve them to find the solution, but how?

Let’s say we are in the middle of the game and we have some cells covered and others uncovered. We can select a specific cell and solve its adjacent cells to eliminate the mines. For example, as shown in the board below:

Get hands-on with 1400+ tech skills courses.