Java DP
\npublic int orderOfLargestPlusSign(int N, int[][] mines) {\n        int[][] grid = new int[N][N];\n        for(int i = 0; i < mines.length; i++){\n            
```\npublic int orderOfLargestPlusSign(int N, int[][] mines) {\n        int[][] grid = new int[N][N];\n        for(int i = 0; i < mines.length; i++){\n            grid[mines[i][0]][mines[i][1]] = 1; \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            for(int j = 0; j < N; j++){\n                if(j == 0){\n                    if(grid[i][j] == 0){\n                        left[i][j] = 1;\n                    }\n                }else{\n                    if(grid[i][j] == 1){\n                        left[i][j] = 0;\n                    }else{\n                        left[i][j] = 1 + left[i][j - 1];\n                    }\n                }\n                \n                if(i == 0){\n                    if(grid[i][j] == 0){\n                        up[i][j] = 1;\n                    }\n                }else{\n                    if(grid[i][j] == 1){\n                        up[i][j] = 0;\n                    }else{\n                        up[i][j] = 1 + up[i - 1][j];\n                    }\n                }\n            }\n        }\n        for(int i = N - 1; i >= 0; i--){\n            for(int j = N - 1; j >= 0; j--){\n                if(j == N - 1){\n                    if(grid[i][j] == 0){\n                        right[i][j] = 1;\n                    }\n                }else{\n                    if(grid[i][j] == 1){\n                        right[i][j] = 0;\n                    }else{\n                        right[i][j] = 1 + right[i][j + 1];\n                    }\n                }\n                \n                if(i == N - 1){\n                    if(grid[i][j] == 0){\n                        down[i][j] = 1;\n                    }\n                }else{\n                    if(grid[i][j] == 1){\n                        down[i][j] = 0;\n                    }else{\n                        down[i][j] = 1 + down[i + 1][j];\n                    }\n                }\n            }\n        }\n        int max = 0;\n        for(int i = 0; i < N; i++){\n            for(int j = 0; j < N; j++){\n                int min = Math.min(up[i][j], down[i][j]);\n                min = Math.min(min, Math.min(left[i][j], right[i][j]));\n                max = Math.max(min, max);\n            }\n        }\n        return max;\n    }\n```
[]