Word Chaining

Statement

Given a list of words, figure out whether the given words can form a circular chain. Assume that a single word can never form a chain.

Two words can be chained together if the first word’s last letter is equal to the second word’s first letter.

Note: Assume that all the words are lower case.

Example

Consider the following words:

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.