C++ || Easy Implementation 
It is just like number of Islands problem using BFS but you have to use priority queue or min heap for the accomodation of weight (time here) and add some more
It is just like number of Islands problem using BFS but you have to use priority queue or min heap for the accomodation of weight (time here) and add some more conditions\n\n\n# Complexity\n- Time complexity: O(N * M)log(N * M)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(N*M)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int dx[4] = {0,1,0,-1};\n    int dy[4] = {1,0,-1,0};\n\n    int minTimeToReach(vector<vector<int>>& movetime) {\n        int rows = movetime.size();\n        int cols = movetime[0].size();\n\n        vector<vector<int>> time(rows,vector<int>(cols,INT_MAX));\n        time[0][0] = 0;\n\n        priority_queue<vector<int>, vector<vector<int>>, greater<vector<int>>> pq;\n        pq.push({0,0,0,0});\n\n        while(!pq.empty())\n        {\n            int curr = pq.top()[0];\n            int x = pq.top()[1];\n            int y = pq.top()[2];\n            int flag = pq.top()[3];\n            pq.pop();\n\n            if(x == rows-1 && y == cols-1) return time[x][y];\n\n            for(int i=0; i<4; i++)\n            {\n                int a = x + dx[i];\n                int b = y + dy[i];\n\n                if(a>=0 && a<rows && b>=0 && b<cols)\n                {\n                    int diff = INT_MAX;\n\n                    if(flag == 0) diff = max(curr,movetime[a][b]) + 1;\n                    else diff = max(curr,movetime[a][b]) + 2;\n\n                    if(time[a][b] > diff)\n                    {\n                        time[a][b] = diff;\n                        if(flag == 0) pq.push({diff,a,b,1});\n                        else if(flag == 1) pq.push({diff,a,b,0});\n                    }\n                        \n                }\n            }\n        }\n\n        return -1;\n    }\n};\n```
['C++']