DIY: Rotting Oranges

Solve the interview question "Rotting Oranges" in this lesson.

Problem Statement

You are given an m * n grid. Each cell in the grid contains one of the three values: [0, 1, 2]. Each value represents the following:

  • 0 represents an empty cell.
  • 1 represents a fresh orange.
  • 2
...
Access this course and 1400+ top-rated courses and projects.