Algorithm · Amazon · Hard
You are given a list words of distinct strings, each made only of lowercase English letters. A word from the list is called a concatenated word if it can be built by joining together, in order, at least two words taken from the same list. Implement list_all_concatenations(words). It must find every concatenated word and report every valid way of splitting it into list words. Rules: Every piece of a split must be a word that appears in words. A word from the list may be used…