Skip to content

Commit 5262c31

Browse files
committed
Fix PMD collapsible if statement.
1 parent 9fde3c5 commit 5262c31

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/main/java/com/thealgorithms/backtracking/WordSearch.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,8 @@ public boolean exist(char[][] board, String word) {
8383
for (int i = 0; i < m; i++) {
8484
for (int j = 0; j < n; j++) {
8585

86-
if (board[i][j] == word.charAt(0)) {
87-
if (dfs(board, i, j, word, 0)) {
86+
if (board[i][j] == word.charAt(0) && dfs(board, i, j, word, 0)) {
8887
return true;
89-
}
9088
}
9189
}
9290
}

0 commit comments

Comments
 (0)