Easy Djikstra solution
Code\npython3 []\nclass Solution:\n    def minTimeToReach(self, moveTime: List[List[int]]) -> int:\n        m, n = len(moveTime), len(moveTime[0])\n        dirs
# Code\n```python3 []\nclass Solution:\n    def minTimeToReach(self, moveTime: List[List[int]]) -> int:\n        m, n = len(moveTime), len(moveTime[0])\n        dirs = [[1,0],[-1,0],[0,1],[0,-1]]\n        times = [[inf] * n for _ in range(m)]\n        times[0][0] = 0\n        min_heap = [[0, 0, 0, 1]]\n\n        while min_heap:\n            steps_taken, x, y, steps = heappop(min_heap)\n            # at what time we could have moves to x, y\n            if x == m-1 and y == n-1:\n                return steps_taken\n            for dx, dy in dirs:\n                tx, ty = x+dx, y+dy\n                if 0 <= tx < m and 0 <= ty < n:\n                    # time taken to move to this cell\n                    ssteps_taken = steps_taken + steps+max(moveTime[tx][ty]-times[x][y], 0)\n                    if ssteps_taken < times[tx][ty]:\n                        heappush( min_heap, [ssteps_taken, tx, ty, (steps%2)+1] )\n                        times[tx][ty] = ssteps_taken\n        return times[m-1][n-1]\n```
['Heap (Priority Queue)', 'Shortest Path', 'Python3']