modified Dijkstra (strivers solution is modifed)
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int minTimeToReach(vector<vector<int>>& moveTime) {\n\n        int n = moveTime.size();\n        int m = moveTime[0].size();\n        priority_queue<pair<int, pair<int, pair<int, bool>>>, \n                   vector<pair<int, pair<int, pair<int, bool>>>>, \n                   greater<pair<int, pair<int, pair<int, bool>>>>> pq;\n        vector<vector<int>> dist(n, vector<int>(m, INT_MAX));\n\n        pq.push({0,{0,{0,false}}});\n        dist[0][0] = 0;\n\n        int dx[] = {0,1,0,-1}; \n        int dy[] = {1,0,-1,0};\n\n        while(!pq.empty()){\n            auto X = pq.top();\n            pq.pop();\n            int distance = X.first;\n            int i = X.second.first;\n            int j = X.second.second.first;\n            bool flg = X.second.second.second;\n\n            for( int d = 0 ; d<4 ; d++){\n                int newi = i + dx[d];\n                int newj = j + dy[d];\n\n                if(newi >= 0 && newi < n && newj >= 0 && newj < m){\n                    int temp = max(distance, moveTime[newi][newj]);\n                    if(flg)temp++;\n                    temp++;\n                    if(temp < dist[newi][newj]){\n                        dist[newi][newj] = temp;\n                        pq.push({temp, {newi,{ newj, !flg}}});\n                    }\n                }\n            }\n        }\n\n        return dist[n-1][m-1];\n    }\n};\n```
['C++']