Skip to content
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

WordBreak #112

Open
knasim opened this issue Nov 29, 2018 · 2 comments
Open

WordBreak #112

knasim opened this issue Nov 29, 2018 · 2 comments

Comments

@knasim
Copy link

knasim commented Nov 29, 2018

No description provided.

@knasim knasim closed this as completed Nov 29, 2018
@knasim knasim reopened this Nov 29, 2018
@knasim
Copy link
Author

knasim commented Nov 29, 2018

interviews/company/uber/WordBreak.java

This is not a good solution for the WordBreak problem referenced above. It will fail for the following input string and any other input string that has a word within a word. i.e buzzword -> this can be broken up into: "buzz", "word".

So for input string == "buzzwordsarecool"
given dictionary ["buzz", "buzzwords", "are", "cool"]
This shall produce: buzz buzzwords are cool

@joimxjtuse
Copy link

This problem only returns boolean. while boolean state is return, this may be a better solution in O(n^2) time complexity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants