We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4260585 commit 85dffcfCopy full SHA for 85dffcf
src/main/java/com/fishercoder/solutions/_1020.java
@@ -13,9 +13,15 @@
13
public class _1020 {
14
public static class Solution1 {
15
public void walk(int[][] A, boolean[][] visited, int x, int y) {
16
- if (x >= A.length || x < 0 || y >= A[0].length || y < 0) return;
17
- if (visited[x][y]) return;
18
- if (A[x][y] == 0) return;
+ if (x >= A.length || x < 0 || y >= A[0].length || y < 0) {
+ return;
+ }
19
+ if (visited[x][y]) {
20
21
22
+ if (A[x][y] == 0) {
23
24
25
26
visited[x][y] = true;
27
0 commit comments