JAVA SIMPLE SOLUTION WITH EXPLANATION FASTER THAN 80% WITH TIME AND SPACE
Explanation:\n   1.for every index we will store all four value(left,right,up,down).\n   2.to improve time complexity we will calculate index(i,j) values usign 
Explanation:\n   1.for every index we will store all four value(left,right,up,down).\n   2.to improve time complexity we will calculate index(i,j) values usign stored value of other indexed.\n\nJAVA CODE IS:\n```\nclass Solution {\n    public int orderOfLargestPlusSign(int N, int[][] mines) {\n      int grid[][][]=new int[N][N][4];\n        for(int k=0;k<=3;k++){\n            for(int a[] : mines)\n                grid[a[0]][a[1]][k]=-1;\n        }\n        for(int i=0;i<N;i++){\n            for(int j=0;j<N;j++){\n                grid[i][j][0]=grid[i][j][0]==-1 ? 0 : j-1<0 ? 1 : grid[i][j-1][0]+1; \n               grid[i][j][1]=grid[i][j][1]==-1 ? 0 : i-1<0 ? 1 : 1+grid[i-1][j][1];  \n            }\n        }\n          for(int i=N-1;i>=0;i--){\n            for(int j=N-1;j>=0;j--){\n                grid[i][j][2]=grid[i][j][2]==-1 ? 0 : j+1>=N ? 1 : 1+grid[i][j+1][2]; \n               grid[i][j][3]=grid[i][j][3]==-1 ? 0 : i+1>=N ? 1 : 1+grid[i+1][j][3];  \n            }\n        }\n        int ans=0;\n        for(int i=0;i<N;i++){\n            for(int j=0;j<N;j++)\n                ans=Math.max(ans,Math.min(grid[i][j][0],Math.min(grid[i][j][1],Math.min(grid[i][j][2],grid[i][j][3]))));\n        }\n        return ans;\n    }\n}\n```\nTime: O(m*4)+O(n*n)+O(n*n)+O(n*n)=O(n^2) means quadratic.\nSpace: O(n*n*4)=O(n*n)\n***PLEASE,UPVOTE IF THIS IS REALLY HELPFUL FOR YOU ***
[]