shlogg · Early preview
Md Ariful Haque @mah-shamim

Minimum Time To Visit Grid Cell In PHP

Modified Dijkstra's algorithm with priority queue finds shortest time to visit bottom-right cell in grid.

2577. Minimum Time to Visit a Cell In a Grid
Difficulty: Hard
Topics: Array, Breadth-First Search, Graph, Heap (Priority Queue), Matrix, Shortest Path
You are given a m x n matrix grid consisting of non-negative integers where grid[row][col] represents the minimum time required to be able to visit the cell (row, col), which means you can visit the cell (row, col) only when the time you visit it is greater than or equal to grid[row][col].
You are standing in the top-left cell of the matrix in the 0th second, and you must move to any adjacent cell in the four directions: up, down, left, and righ...