Leetcode 286. Walls and Gates (BFS - Python)

Published: 30 August 2021
on channel: HelmyCodeCamp
402
5

You are given an m x n grid rooms initialized with these three possible values.

-1 A wall or an obstacle.
0 A gate.
INF Infinity means an empty room. We use the value 231 - 1 = 2147483647 to represent INF as you may assume that the distance to a gate is less than 2147483647.
Fill each empty room with the distance to its nearest gate. If it is impossible to reach a gate, it should be filled with INF.

Connect with me on Linkedin!   / helmy47  


Watch video Leetcode 286. Walls and Gates (BFS - Python) online without registration, duration hours minute second in high quality. This video was added by user HelmyCodeCamp 30 August 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 402 once and liked it 5 people.