Rotting Oranges (OA)

You are given a 2D grid grid where:

  • 0 represents an empty cell
  • 1 represents a fresh orange
  • 2 represents a rotten orange

Every minute, any fresh orange that is **4-directionally adjacen...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: