Easy and intutive solution
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        int m=moveTime.size();\n        int n=moveTime[0].size();\n\n        priority_queue<tuple<int, int, int , int>, vector<tuple<int, int, int, int>>,\n               greater<tuple<int, int, int, int>>>pq;\n        vector<vector<int>>dist(m, vector<int>(n,INT_MAX));\n        pq.push({0,0,0,0});\n\n        int dx[]={0,1,0, -1};\n        int dy[]={1,0,-1, 0};\n        while(!pq.empty()){\n            auto [cost, x, y,move]=pq.top();\n            pq.pop();\n\n            if(x==m-1 && y==n-1) return cost;\n\n            for(int i=0;i<4;i++){\n                int new_x= x+dx[i];\n                int new_y= y+dy[i];\n\n                if(new_x>=0&&new_x<m&& new_y>=0&&new_y<n){\n                   int val=max(cost,moveTime[new_x][new_y])+(move%2==0?1:2);\n                   if(val<dist[new_x][new_y]){\n                     dist[new_x][new_y]=val;\n                     pq.emplace(val, new_x, new_y, 1-(move&1));\n                   }\n                }\n            }\n        }\n        return -1;\n\n    }\n};\n```
['C++']