Minimum Time Takes to Reach Destination Without Drowning
Explore how to determine the shortest safe path from a source to a destination on a dynamic grid affected by flooding. Understand how to navigate through cells avoiding stones and flood zones while calculating the minimum time to reach safely or conclude if it's impossible.
We'll cover the following...
We'll cover the following...
Statement
Given a m x n grid of the string land. It consists of the following types of cells:
S: Source cell where you are standing initially.D: Destination cell where you have to reach..: These cells are empty.X: These cells are stone.*: These cells are flooded.
Each second, you can move to a neighboring cell directly next to your current one. At the same time, any empty cell next to a flooded cell also becomes flooded. There are two ...