Minimum Time Takes to Reach Destination Without Drowning
Flood the grid with one BFS to get each cell’s wet minute, then search the traveler route while every step beats the water.
Flood the grid with one BFS to get each cell’s wet minute, then search the traveler route while every step beats the water.