C++ || Simple Approach || DP || TC: O(4 * (N^2))
TC: O(5 * O(N^2)) ---> ~= O(N^2)\nSC: O(4 * (N^2))  ---->  ~- O(N^2)\n\nclass Solution {\npublic:\n    int orderOfLargestPlusSign(int n, vector<vector<int>>& ar
TC: O(5 * O(N^2)) ---> ~= O(N^2)\nSC: O(4 * (N^2))  ---->  ~- O(N^2)\n```\nclass Solution {\npublic:\n    int orderOfLargestPlusSign(int n, vector<vector<int>>& arr) {\n        \n        vector<vector<int>>nums(n,vector<int>(n,1));\n        for(auto it:arr){\n            nums[it[0]][it[1]]=0;\n        }\n        vector<vector<int>>left=nums,right=nums,up=nums,down=nums;\n        \n        //up\n        for(int i=1;i<n;i++){\n            for(int j=0;j<n;j++)\n                if(up[i][j]==1)\n                    up[i][j]+=up[i-1][j];\n        }\n        //left\n        for(int i=0;i<n;i++){\n            for(int j=1;j<n;j++){\n                if(left[i][j]==1)\n                    left[i][j]+=left[i][j-1];\n            }\n        }\n        //right\n        //down\n        for(int i=n-2;i>=0;i--){\n            for(int j=0;j<n;j++){\n                if(down[i][j]==1)\n                    down[i][j]+=down[i+1][j];\n            }\n        }\n        //right\n        for(int i=0;i<n;i++){\n            for(int j=n-2;j>=0;j--){\n                if(right[i][j]==1)\n                    right[i][j]+=right[i][j+1];\n            }\n        }\n        \n        int maxi=0;\n        for(int i=0;i<n;i++){\n            for(int j=0;j<n;j++){\n                int area= \n                    min({left[i][j],right[i][j],up[i][j],down[i][j]});\n                maxi=max(maxi,area);\n            }\n        }\n        return maxi;\n    }\n};\n```
['Dynamic Programming', 'C++']