Given an array of strings words (without duplicates), return all the concatenated words in the provided list of words.
A concatenated word is defined as a string that is comprised entirely of at least two shorter words in the given array of words.
Example 1:
Input: cat cats catsdogcats dog dogcatsdog hippopotamuses rat ratcatdogcat Output: catsdogcats dogcatsdog ratcatdogcat
Example 2:
Input: a Output: (empty)
Constraints:
- 1 ≤ words.length ≤ 10⁴
- 1 ≤ words[i].length ≤ 30
Input format: Space-separated words on one line.
Output format: Concatenated words, one per line (in order found).