GamifiedGamified challengesPracticeRaceLeaderboardPricing

Learn data structures by watching them move, then doing it yourself. Press M anytime to toggle sound.

A product of Amypo Technologies, Coimbatore.

Learn

  • All topics
  • Learning path
  • How it works
  • About dotprep

Practice

  • Practice arena
  • Daily challenge
  • Gamified challenges
  • Race mode
  • Leaderboard

Interview prep

  • Java interview
  • Coding questions
  • Company questions
  • System design
  • Jobs & careers

You

  • Dashboard
  • Settings
  • Pricing
  • Create account

© 2026 dotprep

Content last updated 20 November 2026

GamifiedGamified challengesPracticeRaceLeaderboardPricing
Log inStart free
Gamified challengesMine Counter Board

Gamified challenge · Neighbour counting

Mine Counter Board

board is a covered field: each row is a string where * is a buried mine and . is a covered safe square. The player uncovers square (r, c) (row r, column c).

If it's a mine, it becomes X and nothing else changes. Otherwise it shows a digit 0–8: how many of its 8 neighbours (diagonals included) are mines. A square showing `0` automatically uncovers all its covered neighbours too, which may be 0s that open further. Mines that weren't hit stay *; squares never reached stay ..

Write reveal(board, r, c) that returns the board after the click. Example: reveal(["*..", "...", "..."], 2, 2) → ["*10", "110", "000"]: the corner (2, 2) is a 0, so the opening spreads until it reaches the squares touching the mine.

Sign in to play Mine Counter Board

This game is part of the paid plans. Sign in, then pick a plan to write your answer, watch it play out, and step through the algorithm with its guide.

Sign in with Google

or log in with email · create an account