Hard
,Array
,String
,DP
,DFS
,Trie
Given an array of strings words
(without duplicates), return all the concatenated words in the given 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.
Example 1:
Example 2:
Constraints:
words.length
<= 104words[i].length
<= 30words[i]
consists of only lowercase English letters.words
are unique.sum(words[i].length)
<= 105Yen-Chi ChenMon, Jan 30, 2023