Simple DP + DFS based Solution
\n# Code\n\nclass Solution {\npublic:\n    int maxMoves(vector<vector<int>>& grid) {\n        int m = grid.size();\n        int n = grid[0].size();\n        \n 
\n# Code\n```\nclass Solution {\npublic:\n    int maxMoves(vector<vector<int>>& grid) {\n        int m = grid.size();\n        int n = grid[0].size();\n        \n        int maxi = 0;\n        vector<vector<int>> dp(m,vector<int>(n,-1));\n        for(int i=0 ; i<m ; i++) {\n            int cnt = dfs(i,0,grid,dp);\n            if(cnt > maxi) maxi = cnt;\n            cnt = 0;\n        }\n        return maxi;\n    }\n    \n    int dfs(int i, int j, vector<vector<int>> &grid, vector<vector<int>> &dp) {\n        if(dp[i][j] != -1) return dp[i][j];\n        int c1=0 , c2=0 , c3=0;\n\n        if(isValid(i-1,j+1,grid[i][j],grid)) c1 = 1 + dfs(i-1,j+1,grid,dp);\n        if(isValid(i,j+1,grid[i][j],grid))   c2 = 1 + dfs(i,j+1,grid,dp);\n        if(isValid(i+1,j+1,grid[i][j],grid)) c3 = 1 + dfs(i+1,j+1,grid,dp);\n\n        return dp[i][j]=max({c1,c2,c3});\n    }\n\n    bool isValid(int i, int j, int curr, vector<vector<int>> &grid) {\n        if(i<0 || j<0 || i>=grid.size() || j>=grid[0].size() || grid[i][j]<=curr) return false;\n        return true;\n    }\n};\n```
['Dynamic Programming', 'Depth-First Search', 'C++']