java simple DP solution, using one matrix, easy to undersatnd
\n    public int orderOfLargestPlusSign(int N, int[][] mines) {\n        int[][]M = new int[N][N];\n        for(int[]arr : M){\n            Arrays.fill(arr, 1);
```\n    public int orderOfLargestPlusSign(int N, int[][] mines) {\n        int[][]M = new int[N][N];\n        for(int[]arr : M){\n            Arrays.fill(arr, 1);\n        }\n        for(int[]arr : mines){\n            M[arr[0]][arr[1]] = 0;\n        }\n        for(int i = 0; i < N; i++){\n            int count = 0;   //left\n            for (int j = 0; j < N; j++) {\n                if (M[i][j] != 0) {\n                    count++;\n                } else {\n                    count = 0;\n                }\n                M[i][j] = count;\n            }\n            count = 0; //right\n            for(int j = N - 1; j >= 0; j--){\n                if (M[i][j] != 0){\n                    count++;\n                } else {\n                    count = 0;\n                }\n                M[i][j] = Math.min(M[i][j], count);\n            }\n        }\n        int result = 0;\n        for(int j = 0; j < N; j++){\n            int count = 0;\n            for(int i = 0; i < N; i++){ //up\n                if(M[i][j] != 0){\n                    count++;\n                } else {\n                    count = 0;\n                }\n                M[i][j] = Math.min(M[i][j], count);\n            }\n            count = 0; //down\n            for(int i = N-1; i >=0; i--){\n                if(M[i][j] != 0){\n                    count++;\n                } else {\n                    count = 0;\n                }\n                M[i][j] = Math.min(M[i][j], count);\n                result = Math.max(result, M[i][j]);\n            }\n        }\n        return result;\n    }\n```
[]