#286

Walls and Gates

medium· Graphsruns: 0

You are given an m x n grid rooms initialized with one of three values: -1 for a wall, 0 for a gate, and 2147483647 (INT_MAX) for an empty room. Fill each empty room with the distance to its nearest gate. If it is impossible to reach a gate, leave the room as INT_MAX. Modify the grid in place.

sign in to paste and practice your own solution
desktop only

codedrill is a typing game and needs a real keyboard. open this on a laptop or desktop to practice.

you can still browse problems and sections from your phone.