✅Easy DFS solution || C++ || 🔥Self Explanatory
\n# Code\n\nclass Solution {\npublic:\n    int dfs(int i,int j,int prev,vector<vector<int>>& grid)\n    {\n        if(i<0 || i==grid.size() || j==grid[0].size()
\n# Code\n```\nclass Solution {\npublic:\n    int dfs(int i,int j,int prev,vector<vector<int>>& grid)\n    {\n        if(i<0 || i==grid.size() || j==grid[0].size() || prev>=grid[i][j]) return 0;\n        prev=grid[i][j];\n        grid[i][j]=0;\n        int res=max(max(dfs(i-1,j+1,prev,grid),dfs(i,j+1,prev,grid)),dfs(i+1,j+1,prev,grid));\n        return res+1;\n    }\n    int maxMoves(vector<vector<int>>& grid) {\n        int ans=0;\n        for(int i=0; i<grid.size(); i++) ans=max(ans,dfs(i,0,0,grid));\n        return ans-1;\n    }\n};\n```\n\nPlease Upvote \uD83E\uDD7A\uD83D\uDE4F
['Depth-First Search', 'C++']