From c7064a632fd1d91f93703bf7da3137f5f2238e87 Mon Sep 17 00:00:00 2001 From: realstealthninja <68815218+realstealthninja@users.noreply.github.com> Date: Tue, 1 Oct 2024 23:11:28 +0530 Subject: [PATCH] fix: typo in word_break --- dynamic_programming/word_break.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dynamic_programming/word_break.cpp b/dynamic_programming/word_break.cpp index 5291f665f..2ec355a4b 100644 --- a/dynamic_programming/word_break.cpp +++ b/dynamic_programming/word_break.cpp @@ -105,7 +105,7 @@ bool check(const std::string &s, const std::unordered_set &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; }