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 represents a rotten orange.

A fresh orange, represented by a 1 in the grid, will be rotten if it is four directionally adjace ...

Create a free account to view this lesson.

Continue your learning journey with a 14-day free trial.

By signing up, you agree to Devpath's Terms of Service and Privacy Policy