Reported August 2026
Nurobreadth first search

Reveal a Minesweeper Region

Reported by candidates from Nuro's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Nuro OA. Under 2s to a working solution.
Founder's read

Nuro reported this one in August 2026, and the detail that matters is the encoding: mines are -1, untouched cells are 0, and a cleared blank becomes -2. That's a flood fill on an 8-neighbor grid, and the example where the origin has a positive count and nothing expands is the one people miss. If you've got an OA coming, expect this exact setup. It's a classic Minesweeper reveal, solved with DFS or BFS from the start cell. The logic is short, but the order of operations is where candidates lose points. If you blank mid-assessment, StealthCoder runs invisibly as a safety net, but read the rules below first.

The problem

You are given a rectangular Minesweeper board. A mine is encoded as -1, and every unrevealed empty cell is encoded as 0.
Reveal the region that begins at the empty cell (startRow, startCol). Two cells are adjacent when their row and column differ by at most one, excluding the cell itself.
When an unrevealed empty cell is reached:
Count the mines among its at most eight adjacent cells.
If the count is positive, replace the cell with that count and do not expand from it.
If the count is zero, replace the cell with -2, then continue the reveal from each adjacent cell that is still 0.
Mines remain -1, and empty cells that are never reached remain 0. Return the resulting board.

Function
revealRegion(board: int[][], startRow: int, startCol: int) → int[][]

Examples
Example 1
board = [[0,0,0,0,0],[0,0,0,-1,0],[0,0,0,0,0],[0,0,0,0,0]]
startRow = 3
startCol = 0
return = [[-2,-2,1,0,0],[-2,-2,1,-1,0],[-2,-2,1,1,1],[-2,-2,-2,-2,-2]]
The reveal begins in the mine-free lower-left region. Every zero-clue cell in that region becomes -2, and its numbered boundary is revealed. Expansion stops at those numbered cells, so the two empty cells beyond the mine remain 0.
Example 2
board = [[0,0,0],[0,0,0]]
startRow = 0
startCol = 1
return = [[-2,-2,-2],[-2,-2,-2]]
The board contains no mines. Every empty cell is connected to the reveal origin and has zero adjacent mines, so every cell becomes -2.
Example 3
board = [[0,-1,0],[0,0,0],[0,0,-1]]
startRow = 1
startCol = 1
return = [[0,-1,0],[0,2,0],[0,0,-1]]
The origin has two adjacent mines, so it is revealed as 2. Because its clue is positive, the reveal does not expand to any neighbor.

Constraints
1 <= board.length <= 200.
1 <= board[r].length <= 200, and every row has the same length.
Every initial cell is -1 or 0.
0 <= startRow < board.length and 0 <= startCol < board[0].length.
board[startRow][startCol] == 0.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The trick is that the cell's own state tells you whether it's been visited. Only process a cell if it's in bounds and still 0. Count mines in the 8 neighbors. If the count is positive, write the count and stop. If zero, write -2 and push every neighbor that is still 0. Because you mark -2 before expanding, you never revisit, so no separate visited array is needed. The common pitfall is using 4-directional movement, or recursing so deep that a 200 by 200 empty board blows the stack. Use an explicit stack or queue to be safe. Another slip is counting a cell's mines after overwriting it, or expanding from numbered cells. Check Example 3 against your code: a positive origin changes nothing else. Complexity is O(rows * cols * 8). If you freeze on the live OA, StealthCoder can surface this BFS skeleton quietly, but the logic here is small enough to own.

Drill it cold or hedge it with StealthCoder. Either way, don't walk into the OA hoping you remember the trick.

If this hits your live OA

You can drill Reveal a Minesweeper Region cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Made for the candidate who got the OA invite this morning and has 72 hours, not six months.

Get StealthCoder

Related leaked OAs

⏵ Practice the LeetCode equivalent

This OA pattern shows up on LeetCode as minesweeper. If you have time before the OA, drill that.

⏵ The honest play

You've seen the question. Make sure you actually pass Nuro's OA.

Nuro reuses patterns across OAs. Made for the candidate who got the OA invite this morning and has 72 hours, not six months. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Reveal a Minesweeper Region FAQ

What's the core trick in Reveal a Minesweeper Region?+

It's flood fill with a stop condition. Count adjacent mines first. A positive count gets written and the search stops there. A zero count becomes -2 and spreads to all 8 neighbors that are still 0. The board itself acts as the visited marker.

Should I use DFS or BFS?+

Either works, but use an iterative stack or queue. The grid can be 200 by 200, so a fully empty board could mean 40,000 recursive calls deep. That risks a stack overflow in some languages. BFS with a queue avoids the problem cleanly.

Do I need a separate visited array?+

No. A cell is unprocessed only while it equals 0. Once you set it to a count or -2, it's no longer 0 and gets skipped. Mark cells when you pop them, or when you push them, so duplicates don't pile up in the queue.

What edge cases does Nuro's version test?+

The origin having a positive count, where nothing expands, is Example 3. Also a board with no mines, which turns everything to -2. And bounds on edges and corners, where fewer than eight neighbors exist. Mines stay -1 and unreached cells stay 0.

How do I prepare for this in 48 hours?+

Write flood fill on a grid twice with 8 directions, once with BFS and once with an explicit stack. Then run the three examples by hand. Practice the neighbor loop with dr and dc from -1 to 1, skipping (0,0). That covers nearly everything this problem needs.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Nuro.

OA at Nuro?
Invisible during screen share
Get it