โ† Amazon questions

Minimum steps to reach an obstacle in a 2D grid

Filed under Amazon

Given a 2D array with land (1), sea (0), and obstacles (9), find the minimum steps required to reach an obstacle moving only through land cells in four directions.

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.