From 775b92b06c5101aee0c7f54c1338ad60fe5738a2 Mon Sep 17 00:00:00 2001 From: Prabhakar Raj <96809320+prabhakar0304@users.noreply.github.com> Date: Sun, 2 Apr 2023 16:33:53 +0530 Subject: [PATCH] Updated PrefixStrings.cpp I comment out 3 lines of code. Since if the str is actually a word, then it will be pushed again in the dfs function. --- DSA Essentials Solutions/Trie/PrefixStrings.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DSA Essentials Solutions/Trie/PrefixStrings.cpp b/DSA Essentials Solutions/Trie/PrefixStrings.cpp index ccff759..cdb382e 100644 --- a/DSA Essentials Solutions/Trie/PrefixStrings.cpp +++ b/DSA Essentials Solutions/Trie/PrefixStrings.cpp @@ -55,9 +55,9 @@ class Trie{ word.push_back(str[i]); temp=temp->next[str[i]]; } - if(temp->isTerminal){ - v.push_back(word); - } +// if(temp->isTerminal){ +// v.push_back(word); +// } dfs(temp,v,word); sort(v.begin(),v.end()); return v;