Skip to content

Commit 11e108c

Browse files
committed
fix for word search this solution only checks if the only letter on the word is equal to the first letter of the word not the whole word
1 parent ab684ff commit 11e108c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Word Search - Leetcode 79/Word Search - Leetcode 79.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var exist = function(board, word) {
44
const W = word.length;
55

66
if (m === 1 && n === 1) {
7-
return board[0][0] === word[0];
7+
return board[0][0] === word;
88
}
99

1010
const backtrack = function(i, j, index) {

0 commit comments

Comments
 (0)