Easy Solution Using Dp Time-O(N*2) Space-O(N*2) In [C++/Java]
\nclass Solution {\npublic:\n    int orderOfLargestPlusSign(int n, vector<vector<int>>& v) {\n        vector<vector<int>>dp(n,vector<int>(n,1));\n        for(in
```\nclass Solution {\npublic:\n    int orderOfLargestPlusSign(int n, vector<vector<int>>& v) {\n        vector<vector<int>>dp(n,vector<int>(n,1));\n        for(int i=0;i<v.size();i++)\n        {\n            dp[v[i][0]][v[i][1]]=0;\n        }\n        //Now we have our matrix of 0\'s and 1\'s\n        //Now what we will do is create 4 vectors to keep track of each direction having continous ones.\n        vector<vector<int>>left(n,vector<int>(n,0));\n        vector<vector<int>>right(n,vector<int>(n,0));\n        vector<vector<int>>top(n,vector<int>(n,0));\n        vector<vector<int>>down(n,vector<int>(n,0));\n        \n        for(int i=0;i<n;i++)\n        {\n            for(int j=0;j<n;j++)\n            {\n                if(j==0)\n                {\n                    left[i][j]=dp[i][j];\n                }\n               else if(dp[i][j]==1)\n                    left[i][j]=left[i][j-1]+1;\n                else\n                    left[i][j]=0;\n            }\n        }\n        for(int i=0;i<n;i++)\n        {\n            for(int j=n-1;j>=0;j--)\n            {\n                if(j==n-1)\n                {\n                    right[i][j]=dp[i][j];\n                }\n               else if(dp[i][j]==1)\n                    right[i][j]=right[i][j+1]+1;\n                else\n                    right[i][j]=0;\n            }\n        }\n        for(int i=0;i<n;i++)\n        {\n            for(int j=0;j<n;j++)\n            {\n                if(i==0)\n                {\n                    top[i][j]=dp[i][j];\n                }\n               else if(dp[i][j]==1)\n                    top[i][j]=top[i-1][j]+1;\n                else\n                    top[i][j]=0;\n            }\n        }\n        for(int i=n-1;i>=0;i--)\n        {\n            for(int j=0;j<n;j++)\n            {\n                if(i==n-1)\n                {\n                    down[i][j]=dp[i][j];\n                }\n               else if(dp[i][j]==1)\n                    down[i][j]=down[i+1][j]+1;\n                else\n                    down[i][j]=0;\n            }\n        }\n        int order=0;\n        for(int i=0;i<n;i++)\n        {\n            for(int j=0;j<n;j++)\n            {\n                int curr=min(left[i][j],min(right[i][j],min(top[i][j],down[i][j])));\n                order=max(order,curr);\n            }\n        }\n        return order;\n    }\n};\n```\nJava\n```\nclass Solution {\n    public int orderOfLargestPlusSign(int n, int[][] v) {\n        int[][] arr=new int[n][n];\n        int[][] left=new int[n][n];\n        int[][] right=new int[n][n];\n        int[][] up=new int[n][n];\n        int[][] down=new int[n][n];\n        for(int i=0;i<n;i++)\n        {\n            for(int j=0;j<n;j++)\n            {\n                arr[i][j]=1;\n                up[i][j]=0;\n                left[i][j]=0;\n                right[i][j]=0;\n                down[i][j]=0;\n            }\n        }\n        if(v.length>0)\n        {\n        for(int i=0;i<v.length;i++)\n        {\n            arr[v[i][0]][v[i][1]]=0;\n        }\n        }\n        for(int i=0;i<n;i++)\n        {\n            for(int j=0;j<n;j++)\n            {\n                if(arr[i][j]==1)\n                {\n                    if(j==0)\n                    {\n                       left[i][j]=arr[i][j]; \n                    }\n                    else \n                    {\n                        left[i][j]=left[i][j-1]+1;\n                    }\n                }\n            }\n        }\n        for(int i=0;i<n;i++)\n        {\n            for(int j=n-1;j>=0;j--)\n            {\n                if(arr[i][j]==1)\n                {\n                    if(j==n-1)\n                    {\n                       right[i][j]=arr[i][j]; \n                    }\n                    else \n                    {\n                        right[i][j]=right[i][j+1]+1;\n                    }\n                }\n            }\n        }\n        for(int i=0;i<n;i++)\n        {\n            for(int j=0;j<n;j++)\n            {\n                if(arr[i][j]==1)\n                {\n                    if(i==0)\n                    {\n                       up[i][j]=arr[i][j]; \n                    }\n                    else \n                    {\n                        up[i][j]=up[i-1][j]+1;\n                    }\n                }\n            }\n        }\n        for(int i=n-1;i>=0;i--)\n        {\n            for(int j=0;j<n;j++)\n            {\n                if(arr[i][j]==1)\n                {\n                    if(i==n-1)\n                    {\n                       down[i][j]=arr[i][j]; \n                    }\n                    else \n                    {\n                        down[i][j]=down[i+1][j]+1;\n                    }\n                }\n            }\n        }\n        int ans=0;\n        for(int i=0;i<n;i++)\n        {\n            for(int j=0;j<n;j++)\n            {\n                if(arr[i][j]==1)\n                {\n                  ans=Math.max(ans,Math.min(left[i][j],Math.min(right[i][j],Math.min(up[i][j],down[i][j]))));  \n                }\n            }\n        }\n        return ans;\n        \n    }\n}```
[]