Premium problem52. Minesweeper: Adjacent Counts

Hard Locked

Add an 'adjacent' column giving the number of mines on the (up to 8) adjacent squares, for the seeded X by Y grid. Build the grid the same way: np.random.seed(seed) immediately before drawing the mines, inside solve, with probability p. Return the DataFrame with the counts as integers.

Input

X = 5, Y = 4, p = 0.4, seed = 0

Premium problem

This one's part of Premium. Unlock the full Pandas track plus every other premium problem on the site.

Implement solve(...)