← Amazon questions

Rotten Oranges / Mangoes infection time

Filed under Amazon

Given an N x M grid where 0 is empty, 1 is a good mango, and 2 is a bad mango, find the minimum days required for all good mangoes to turn bad. Bad mangoes infect adjacent good ones daily. Return -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.

Related Amazon questions

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