I am stuck at a programming question. I need help!
The question is as follows. Given a list of words I have to return true if it is possible to create a chain of words as follows.
cat tab bat etc. i.e end letter of a word has to be start of the other in the chain.
How should I implement this?
I can only think of the brute force solution where I generate all permutations of a list and then check if any of it meets the conditions.
Thanks.