mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-05-08 23:23:05 +08:00
fix: typo in word_break
This commit is contained in:
@@ -105,7 +105,7 @@ bool check(const std::string &s, const std::unordered_set<std::string> &strSet,
|
||||
// if the prefix till current position is present in the dictionary
|
||||
// and the remaining substring can also be segmented legally, then
|
||||
// set solution at position pos in the memo, and return true
|
||||
if (exists(wordTillNow, strSet) and check(s, strSet, i + 1, dp)) {
|
||||
if (exists(wordTillNow, strSet) && check(s, strSet, i + 1, dp)) {
|
||||
dp->at(pos) = 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user