Concatenated Words with All Decompositions

Asked at Amazon · Coding Questions · Difficulty: Hard

Given a list of unique lowercase strings `words`, a word is *concatenated* if it can be formed by joining **at least two** words from the list, in order (a word may be reused). Find every concatenated word and output all of its valid decompositions.

Loading the problem…