← Microsoft questions

Time Required to Rot All Apples in Matrix

Filed under Microsoft

Given an M x N matrix where 0 represents an empty cell, 1 represents a fresh apple, and 2 represents a rotten apple, determine the minimum time units required for all fresh apples to rot. Every…

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.