C++||DP+Memoization||Recursion||Easy to Understand
```\nclass Solution {\npublic:\n    int dp[500][500][4];\n    int dir[5]={0,1,0,-1,0};\n    int solve(vector> &grid,int n,int r,int c,int d)\n    {\n        if(
```\nclass Solution {\npublic:\n    int dp[500][500][4];\n    int dir[5]={0,1,0,-1,0};\n    int solve(vector<vector<int>> &grid,int n,int r,int c,int d)\n    {\n        if(r<0||c<0||r>=n||c>=n||grid[r][c]==0)\n            return 0;\n        if(dp[r][c][d]!=-1)\n            return dp[r][c][d];\n        return dp[r][c][d]=1+solve(grid,n,r+dir[d],c+dir[d+1],d);\n        \n    }\n    int orderOfLargestPlusSign(int n, vector<vector<int>>& mines) \n    {\n        memset(dp,-1,sizeof(dp));\n        vector<vector<int>> grid(n,vector<int>(n,1));\n        for(auto &v:mines)\n        {\n            grid[v[0]][v[1]]=0;\n        }\n        int ans=0;\n        for(int i=0;i<n;i++)\n        {\n            for(int j=0;j<n;j++)\n            {\n                int plus=solve(grid,n,i,j,0);\n                for(int d=1;d<4;d++)\n                {\n                    plus=min(plus,solve(grid,n,i,j,d));\n                    \n                }\n                ans=max(plus,ans);\n            }\n        }\n        return ans;\n        \n    }\n};\n//if you like the solution plz upvote.
['Dynamic Programming', 'Recursion', 'Memoization', 'C']