← Amazon questions

Find minimum distance of open points to nearest person in a 2D grid

Filed under Amazon

Given a 2D grid containing people, open points, and blocked locations, find the minimum distance from each open point to its nearest person using 4-way movement. Store -1 if a person is unreachable.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.