File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
src/main/java/com/fishercoder/solutions Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -86,11 +86,11 @@ public int orderOfLargestPlusSign(int N, int[][] mines) {
86
86
for (int row = 0 ; row < N ; row ++) {
87
87
for (int col = 0 ; col < N ; col ++) {
88
88
int k = 0 ;
89
- while (k <= row && row < N - k && k <= col && col < N - k &&
90
- !banned .contains ((row - k ) * N + col ) &&
91
- !banned .contains ((row + k ) * N + col ) &&
92
- !banned .contains (row * N + col - k ) &&
93
- !banned .contains (row * N + col + k )) {
89
+ while (k <= row && row < N - k && k <= col && col < N - k
90
+ && !banned .contains ((row - k ) * N + col )
91
+ && !banned .contains ((row + k ) * N + col )
92
+ && !banned .contains (row * N + col - k )
93
+ && !banned .contains (row * N + col + k )) {
94
94
k ++;
95
95
}
96
96
result = Math .max (result , k );
@@ -122,7 +122,7 @@ public int orderOfLargestPlusSign(int N, int[][] mines) {
122
122
}
123
123
124
124
count = 0 ;
125
- for (int col = N - 1 ; col >= 0 ; col --) {
125
+ for (int col = N - 1 ; col >= 0 ; col --) {
126
126
count = banned .contains (row * N + col ) ? 0 : count + 1 ;
127
127
dp [row ][col ] = Math .min (dp [row ][col ], count );
128
128
}
You can’t perform that action at this time.
0 commit comments