Given a 2D grid containing empty rooms (0), doors (1), and walls (-1), calculate the distance from each empty room to the nearest door. If a room cannot reach a door, keep it as -1.
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.