We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
You have an array of english words {cat, then, hen, end, dog}. Can you make out if the given sentence is a concatenation of only words from the array?
{cat, then, hen, end, dog}
Cathen -> valid thend -> not valid cathenend -> valid
Cathen
valid
thend
not valid
cathenend
I think a trie can be used here. Like a suffix tree. What do you think? (google qn btw)
EDIT: GFG link
The text was updated successfully, but these errors were encountered:
No branches or pull requests
You have an array of english words
{cat, then, hen, end, dog}
. Can you make out if the given sentence is a concatenation of only words from the array?Cathen
->valid
thend
->not valid
cathenend
->valid
I think a trie can be used here. Like a suffix tree. What do you think? (google qn btw)
EDIT: GFG link
The text was updated successfully, but these errors were encountered: