Problem
You are given am × n 2D grid initialized with these three possible values:
-1- A wall or obstacle that can not be traversed.0- A gate.INF- Infinity an empty room. We use the value2^31 - 1 = 2147483647to representINF.
INF.
Follow up: Can you solve it in-place and in O(m × n) time complexity?
Examples
Constraints
m == rooms.lengthn == rooms[i].length1 <= m, n <= 100rooms[i][j]is one of-1,0, or2147483647.