A mine-sweeper map can be expressed as an r×cgrid, and each cell of the grid is either mine cell or non-mine cell. A mine cell has no number on it, while a non-mine cell has a number, the number of mine cells that share at least one common point with the cell, on it. Following is a 16×30mine-sweeper map, where flag cells denotes mine cells while blank cells denotes non-mine cells with number 0 on them.