DIY: Walls and Gates

Solve the interview question "Walls and Gates" in this lesson.

We'll cover the following...

Problem

You are given a m×nm \times n 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
1-1 A wall or an obstacle
0
...