Pinterest interview question

Write code to generate a grid for Minesweeper (the game)