-
Notifications
You must be signed in to change notification settings - Fork 269
Trie problems #117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trie problems #117
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ashokdey Test cases where all-words-in-trie
and total-words-in-trie
failed:
- In all-words-in-trie`
- words = ['bed', 'ball', 'ball'];
- output: 2
- expected output: 3
total-words-in-trie
- words = ['bed', 'ball', 'ball']
- output : ['bed', 'ball']
- expected output : ['bed', 'ball', 'ball']
@ashokdey Test cases where
all-words-in-trie
andtotal-words-in-trie
failed:
In all-words-in-trie`
- words = ['bed', 'ball', 'ball'];
- output: 2
- expected output: 3
total-words-in-trie
- words = ['bed', 'ball', 'ball']
- output : ['bed', 'ball']
- expected output : ['bed', 'ball', 'ball']
Do Tries store the same word twice? The path is same hence I don't see a chance it will store the same word more than once.
@ashokdey Suppose I inserted 'ball' 2 times in trie. Path will be same .
Now I asked you tell me the count of unique string then answer should be 1 and tell me count of total string , it should be 2.
Problem is count total words therefore word repetition can be found in input.
Thanks, done! 💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh oh!
There was an error while loading. Please reload this page.
🔍 What's inside?
This PR contains a few problems involving Trie DataStructure.