DIY: Walls and Gates
Explore the Walls and Gates problem where you'll apply data structures and algorithms to compute the shortest distance from empty rooms to gates in a grid. This lesson helps you understand grid traversal techniques and how to handle obstacles effectively, preparing you for similar Amazon coding interview problems.
We'll cover the following...
We'll cover the following...
Problem
You are given a grid represented by a 2D array named rooms. The grid represents rooms where a cell can either be a wall, a gate, or an empty space. The rooms are initialized with these three possible values.
| Values | Represents |
|---|---|
| A wall or an obstacle | |