kdn251/interviews

WordBreak

knasim opened this issue · 2 comments

WordBreak

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

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