Largest_Plus_Sign
\nclass Solution {\npublic:\n    int orderOfLargestPlusSign(int n, vector<vector<int>>& mines) {\n        int left[n][n];\n        int right[n][n];\n        int
```\nclass Solution {\npublic:\n    int orderOfLargestPlusSign(int n, vector<vector<int>>& mines) {\n        int left[n][n];\n        int right[n][n];\n        int up[n][n];\n        int down[n][n];\n        int ans = 0;\n        int dp[n][n];\n        for(int i = 0 ;i<n;i++)\n        {\n            for(int j=0;j<n;j++)\n            {\n                dp[i][j] = 1;\n                up[i][j] = 1;\n                down[i][j] = 1;\n                left[i][j] = 1;\n                right[i][j] = 1;\n            }\n        }\n        for(int i=0;i<mines.size();i++)\n        {\n            dp[mines[i][0]][mines[i][1]] = 0;\n            up[mines[i][0]][mines[i][1]] = 0;\n            down[mines[i][0]][mines[i][1]] = 0;\n            left[mines[i][0]][mines[i][1]] = 0;\n            right[mines[i][0]][mines[i][1]] = 0;\n        }\n        int i = 0;\n        for(int i = 1;i<n;i++)\n        {\n            for(int j =1;j<n;j++)\n            {\n                if(up[i][j]!=0)\n                {\n                    up[i][j]+=up[i-1][j];\n                }\n                if(left[i][j]!=0)\n                {\n                    left[i][j]+=left[i][j-1];\n                }\n            }\n        }\n       for(int i = n-2;i>=0;i--)\n        {\n            for(int j =n-2;j>=0;j--)\n            {\n                if(down[i][j]!=0)\n                {\n                    down[i][j]+=down[i+1][j];\n                }\n                if(right[i][j]!=0)\n                {\n                     right[i][j]+=right[i][j+1];\n                }\n            }\n        }\n        \n        for(int i = 1; i<n-1;i++)\n        {\n            for(int j = 1;j<n-1;j++)\n            {\n                ans = max(ans,min(min(left[i][j],right[i][j]),min(up[i][j],down[i][j])));\n            }\n        }\n        if(ans==0)\n        {\n            if(n*n!=mines.size())\n            {\n                return 1;\n            }\n        }\n        return ans;\n    }\n};\n```
[]