Yahoo India Web Search

Search results

  1. Given a grid of dimension nxm where each cell in the grid can have values 0, 1 or 2 which has the following meaning:0 : Empty cell 1 : Cells have fresh oranges 2 : Cells have rotten oranges . We have to determine what is the earliest ti.

  2. Sep 17, 2024 · Given a matrix of dimension M * N, where each cell in the matrix can have values 0, 1 or 2 which has the following meaning: 0: Empty cell. 1: Cells have fresh oranges. 2: Cells have rotten oranges. The task is to the minimum time required so that all the oranges become rotten.

    • 17 min
  3. Rotting Oranges - You are given an m x n grid where each cell can have one of three values: * 0 representing an empty cell, * 1 representing a fresh orange, or * 2 representing a rotten orange. Every minute, any fresh orange that is 4-directionally adjacent to a rotten orange becomes rotten.

  4. May 27, 2024 · The idea is to use Breadth First Search. The condition of oranges getting rotten is when they come in contact with other rotten oranges. This is similar to a breadth-first search where the graph is divided into layers or circles and the search is done from lower or closer layers to deeper or higher layers.

  5. Aug 20, 2018 · A problem of finding the minimum number of minutes to rot all oranges in a grid. See the description, examples, and solutions in Java, C++, Python, Go, and TypeScript.

  6. Learn how to solve the dynamic programming problem of rotten oranges on GeeksforGeeks using C++ and Java. Watch the video, get the link to the problem, the codes and notes, and other resources from takeUforward.

    • 23 min
    • 316.7K
    • take U forward
  7. People also ask

  8. A solution to the LeetCode problem 0994, where you have to find the minimum number of minutes to rot all oranges in a grid. The solution uses BFS and a queue to check the adjacent oranges and update the grid.

  1. Searches related to rotten oranges gfg practice

    flood fill gfg practice