How do I solve this minesweeper algorithm?

Oh awesome solution!

After looking at your code, It turns out there is no “special value” - you treated the mines as a normal cell which can be incremented based on other mines around it. (I perceived the diagram incorrectly)

The way I did it when I wrote my response considered the “mines” as a special value. Here is a repl using my algorithm. (It is incorrect and took a lot more lines!)

Thanks for sharing your solution!

1 Like