2814. Minimum Time Takes to Reach Destination Without Drowning
ArrayBreadth-First SearchMatrix
Hints
Hint 1
Think of using breadth-first search.
Hint 2
Use a BFS to find for each cell the time at which it will become flooded.
Hint 3
Another BFS then simulates your movement, taking into account information gathered by the first BFS.
Preparing judge…