Minimum Time to Complete Tasks with Dependencies
You are given N tasks numbered from 0 to N-1. Each task takes 1 unit of time to complete. Some tasks depend on the completion of other tasks and can only start once all their prerequisite tasks are finished. You are given a list of dependency pairs (a, b), meaning task a must be completed before task b can start.
You have unlimited resources a
Asked in: ZOMATO
Rotten Oranges
You are given an N x M grid representing a storage area for oranges. Each cell in the grid can be:
- 0: empty cell
- 1: fresh orange
- 2: rotten orange
A rotten orange at position (i, j) spreads rot to its adjacent fresh oranges (up, down, left, right) every minute. The rotting process happens simultaneously for all rotten oranges at each time step.
Your task i
Asked in: ZOMATO