APPROACH 1- PAIR TYPE 2D VECTOR | APPROACH 2- SIMPLE 2D DP
\nstruct Cell{\n    int ver;\n    int hori;\n};\n\nclass Solution {\npublic:\n    int orderOfLargestPlusSign(int N, vector<vector<int>>& mines) {\n        int r
```\nstruct Cell{\n    int ver;\n    int hori;\n};\n\nclass Solution {\npublic:\n    int orderOfLargestPlusSign(int N, vector<vector<int>>& mines) {\n        int res=0;\n        vector<vector<int>> arr(N,vector<int>(N,1));\n        for(auto pair: mines){\n            int x=pair[0];\n            int y=pair[1];\n            arr[x][y]=0;\n        }\n        vector<vector<Cell>> dp(N,vector<Cell>(N,{0,0}));\n        for(int i=0;i<N;i++){\n            for(int j=0;j<N;j++){\n                if(arr[i][j]==1){\n                    res=1;\n                    if(i==0 && j==0){\n                        dp[i][j].hori=1;\n                        dp[i][j].ver=1;\n                    }\n                    else if(i==0){\n                        dp[i][j].hori=dp[i][j-1].hori+1;\n                        dp[i][j].ver=1;\n                    }\n                    else if(j==0){\n                        dp[i][j].ver=dp[i-1][j].ver+1;\n                        dp[i][j].hori=1;\n                    }\n                    else{\n                        dp[i][j].hori=dp[i][j-1].hori+1;\n                        dp[i][j].ver=dp[i-1][j].ver+1;\n                    }\n                }\n            }\n        }\n        for(int i=N-2;i>0;i--){\n            for(int j=N-2;j>0;j--){\n                if(dp[i][j].ver==0 || dp[i][j].hori==0 || dp[i][j].hori==1 || dp[i][j].ver==1){\n                    continue;\n                }\n                int mn=min(dp[i][j].ver,dp[i][j].hori);\n                int side=mn;\n                while(side>0){\n                    if(side+i-1>=N || side+j-1>=N){\n                        side--;\n                        continue;\n                    }\n                    if(dp[i][j+side-1].hori>=side && dp[i+side-1][j].ver>=side){\n                        break;\n                    }\n                    side--;\n                }\n                res=max(res,side);\n            }\n        }\n        return res;\n    }\n};\n```\n\n\n\n```\nclass Solution {\npublic:\n    int orderOfLargestPlusSign(int n, vector<vector<int>>& mines) {\n        vector<vector<int>> dp(n,vector<int>(n,INT_MAX));\n        vector<vector<int>> mat(n,vector<int>(n,1));\n        for(auto pair: mines){\n            int x=pair[0];\n            int y=pair[1];\n            mat[x][y]=0;\n        } \n        for(int i=0;i<n;i++){\n            int count=0;\n            for(int j=0;j<n;j++){  //moving left->right\n                mat[i][j]==1 ? count++ : count=0;\n                dp[i][j]=min(dp[i][j],count);\n            }\n            count=0;\n            for(int j=n-1;j>=0;j--){ //moving right->left\n                mat[i][j]==1 ? count++ : count=0;\n                dp[i][j]=min(dp[i][j],count);\n            }\n        }\n        for(int i=0;i<n;i++){\n            int count=0;\n            for(int j=0;j<n;j++){  //moving top->bottom\n                mat[j][i]==1 ? count++ : count=0;\n                dp[j][i]=min(dp[j][i],count);\n            }\n            count=0;\n            for(int j=n-1;j>=0;j--){ //moving bottom->top\n                mat[j][i]==1 ? count++ : count=0;\n                dp[j][i]=min(dp[j][i],count);\n            }\n        }\n        int res=0;\n        for(int i=0;i<n;i++){\n            res=max(res,*max_element(dp[i].begin(),dp[i].end()));\n        }\n        return res;\n    }\n};\n```
['Dynamic Programming', 'C']