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

Interesting Dyn. Pgming question #11

Open
santhoshvai opened this issue Jun 30, 2015 · 0 comments
Open

Interesting Dyn. Pgming question #11

santhoshvai opened this issue Jun 30, 2015 · 0 comments
Labels

Comments

@santhoshvai
Copy link
Contributor

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

@santhoshvai santhoshvai changed the title Check this question Interesting Dyn. Pgming question Aug 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant