Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
TheSTL merged 10 commits into master from trie
Oct 22, 2019
Merged

Trie problems #117

TheSTL merged 10 commits into master from trie
Oct 22, 2019

Conversation

Copy link
Member

@ashokdey ashokdey commented Oct 20, 2019
edited
Loading

🔍 What's inside?

This PR contains a few problems involving Trie DataStructure.

  • Total count of words in a Trie
  • All the words in a Trie

@ashokdey ashokdey marked this pull request as ready for review October 21, 2019 05:22
Copy link
Member

@TheSTL TheSTL left a 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 reacted with eyes emoji
Copy link
Member Author

@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']

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.

Copy link
Member

TheSTL commented Oct 22, 2019
edited
Loading

@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.

ashokdey reacted with thumbs up emoji

Copy link
Member Author

Thanks, done! 💯

TheSTL reacted with hooray emoji

Copy link
Member

@TheSTL TheSTL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ashokdey 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@TheSTL TheSTL TheSTL approved these changes

Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /