You are given a grid where -1 is a wall, 0 is a gate, and 2147483647 (INF) is an empty room. Fill each empty room with the distance to its nearest gate (leave INF if unreachable). Return the grid.
Input
r cOutput: the filled grid, one row per line.
4 4 2147483647 -1 0 2147483647 2147483647 2147483647 2147483647 -1 2147483647 -1 2147483647 -1 0 -1 2147483647 2147483647
3 -1 0 1 2 2 1 -1 1 -1 2 -1 0 -1 3 4
1 2 -1 0
-1 0
Run your code against the sample tests, or Submit to run the full suite.