8000 fixbug in chapBFS.tex section 1 · silverashashash/leetcode@7148d59 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7148d59

Browse files
committed
fixbug in chapBFS.tex section 1
1 parent 60a44ba commit 7148d59

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

C++/chapBFS.tex

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ \subsubsection{代码}
6363

6464
swap(c, new_word[i]);
6565

66-
if (dict.count(new_word) > 0 &&
66+
if ((dict.count(new_word) > 0 || new_word == end) &&
6767
!visited.count(new_word)) {
6868
result.push_back(new_word);
6969
visited.insert(new_word);
@@ -171,7 +171,7 @@ \subsubsection{代码}
171171

172172
swap(c, new_word[i]);
173173

174-
if ((dict.count(new_word) > 0|| new_word == end) &&
174+
if ((dict.count(new_word) > 0 || new_word == end) &&
175175
!visited.count(new_word)) {
176176
result.insert(new_word);
177177
}
@@ -586,4 +586,4 @@ \subsubsection{只用一个队列的写法}
586586
//return 0;
587587
}
588588
}
589-
\end{Codex}
589+
\end{Codex}

0 commit comments

Comments
 (0)
0