← Microsoft questions

Minimum Time to Rot All Oranges

Filed under Microsoft · Also reported at OYO

Given an m x n grid containing 0 (empty cell), 1 (fresh orange), or 2 (rotten orange), determine the minimum time until all fresh oranges rot. If impossible, 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 Microsoft questions

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