Algorithm · Pinduoduo · Medium
You are given a rectangular character matrix board representing a Minesweeper game. The board contains the following characters: 'M': an unrevealed mine. 'E': an unrevealed empty square. 'B': a revealed blank square (no mines in any of the 8 neighboring cells). A digit from '1' to '8': a revealed square that has that many adjacent mines. 'X': a mine that was clicked. You are also given a click position as an integer array click = [r, c], indicating the row and column indices…