102ms java Trie + DFS solution. With explanation, easy to understand.
\npublic List<String> findAllConcatenatedWordsInADict(String[] words) {\n        List<String> res = new ArrayList<String>();\n        if (words == null || words
```\npublic List<String> findAllConcatenatedWordsInADict(String[] words) {\n        List<String> res = new ArrayList<String>();\n        if (words == null || words.length == 0) {\n            return res;\n        }\n        TrieNode root = new TrieNode();\n        for (String word : words) { // construct Trie tree\n            if (word.length() == 0) {\n                continue;\n            }\n            addWord(word, root);\n        }\n        for (String word : words) { // test word is a concatenated word or not\n            if (word.length() == 0) {\n                continue;\n            }\n            if (testWord(word.toCharArray(), 0, root, 0)) {\n                res.add(word);\n            }\n        }\n        return res;\n    }\n    public boolean testWord(char[] chars, int index, TrieNode root, int count) { // count means how many words during the search path\n        TrieNode cur = root;\n        int n = chars.length;\n        for (int i = index; i < n; i++) {\n            if (cur.sons[chars[i] - 'a'] == null) {\n                return false;\n            }\n            if (cur.sons[chars[i] - 'a'].isEnd) {\n                if (i == n - 1) { // no next word, so test count to get result.\n                    return count >= 1;\n                }\n                if (testWord(chars, i + 1, root, count + 1)) {\n                    return true;\n                }\n            }\n            cur = cur.sons[chars[i] - 'a'];\n        }\n        return false;\n    }\n    public void addWord(String str, TrieNode root) {\n        char[] chars = str.toCharArray();\n        TrieNode cur = root;\n        for (char c : chars) {\n            if (cur.sons[c - 'a'] == null) {\n                cur.sons[c - 'a'] = new TrieNode();\n            }\n            cur = cur.sons[c - 'a'];\n        }\n        cur.isEnd = true;\n    }\n}\nclass TrieNode {\n    TrieNode[] sons;\n    boolean isEnd;\n    public TrieNode() {\n        sons = new TrieNode[26];\n    }\n```
[]