Skip to content

Commit c7064a6

Browse files
fix: typo in word_break
1 parent 7da9561 commit c7064a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dynamic_programming/word_break.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ bool check(const std::string &s, const std::unordered_set<std::string> &strSet,
105105
// if the prefix till current position is present in the dictionary
106106
// and the remaining substring can also be segmented legally, then
107107
// set solution at position pos in the memo, and return true
108-
if (exists(wordTillNow, strSet) and check(s, strSet, i + 1, dp)) {
108+
if (exists(wordTillNow, strSet) && check(s, strSet, i + 1, dp)) {
109109
dp->at(pos) = 1;
110110
return true;
111111
}

0 commit comments

Comments
 (0)