Fill Rooms with Distance to the Nearest Gate
Asked at Meta · Coding Questions · Difficulty: Medium
You are given a grid of rooms. Some rooms are gates, some are empty, and some cells are walls. For every empty room, work out how many steps it takes to walk to the nearest gate, and write that number into the grid.
Loading the problem…
More Meta interview questions
- LLM conceptual questions
- Implement a Two-Hidden-Layer MLP with Backpropagation in NumPy
- Dot Product with Run-Length Encoded Vectors
- Count Lakes Wrapped by a Given Island
- Minimum Remove to Make Valid Parentheses
- LLM with Beam Search and Nucleus Sampling (Meta MSL)