โ Amazon questionsShortest distance to nearest door in a grid
Filed under Amazon
Given a 2D grid containing walls (-1), doors (0), and empty spaces (INF), calculate the shortest distance from each empty space to the nearest door.
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.
Collected from public candidate posts and coding forums. Updated Nov 2026.