Medium
Fill each empty room with the distance to its nearest gate. -1 is a wall, 0 is a gate, and 2147483647 (INF) is an empty room. If a room cannot reach a gate, leave it as INF. Return the filled grid.
Input: rooms = [[2147483647,-1,0,2147483647],[2147483647,2147483647,2147483647,-1],[2147483647,-1,2147483647,-1],[0,-1,2147483647,2147483647]] Output: [[3,-1,0,1],[2,2,1,-1],[1,-1,2,-1],[0,-1,3,4]]