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 db0b917 commit 05861c8Copy full SHA for 05861c8
problems/79.word-search.md
@@ -136,8 +136,9 @@ _Java Code_
136
```java
137
public class LC79WordSearch {
138
public boolean exist(char[][] board, String word) {
139
- if (board == null || board.length == 0 || board[0].length == 0
140
- || word == null || word.length() == 0) return true;
+ if (board == null || word == null) return false;
+ if (word.length() == 0) return true;
141
+ if (board.length == 0) return false;
142
int rows = board.length;
143
int cols = board[0].length;
144
for (int r = 0; r < rows; r++) {
0 commit comments