Java: Trie
Note: With the new test cases this solution gives TLE.\n\n\n\n\npublic List<String> findAllConcatenatedWordsInADict(String[] words) {\n        TrieNode root = b
Note: With the new test cases this solution gives TLE.\n\n\n```\n\npublic List<String> findAllConcatenatedWordsInADict(String[] words) {\n        TrieNode root = buildTrie(words);\n        List<String> result = new ArrayList();\n        for(String word : words){\n            if(searchWords(root, word, 0, 0))\n                result.add(word);\n        }\n        return result;\n    }\n    \n    private boolean searchWords(TrieNode root, String word, int idx, int count){\n\n        int n = word.length();\n        TrieNode node = root;\n        for(int i=idx ; i<n ; i++){\n            char c = word.charAt(i);\n            node = node.next[c - \'a\'];\n            if(node == null) return false;\n            \n            if(node.isWord){\n                //check at the end\n                if(i == n-1){\n                    //check at least this word is made of more than 1 word\n                    return count >= 1;\n                } else{\n                    if(searchWords(root, word, i+1, count+1))\n                        return true;\n                }\n            }\n            \n        }\n        return false;\n    }\n    \n    private TrieNode buildTrie(String[] words){\n        TrieNode root = new TrieNode();\n        for(String word : words){\n            if(word.isEmpty()) continue;\n            TrieNode node = root;\n            for(int i=0 ; i<word.length() ; i++){\n                char c = word.charAt(i);\n                if(node.next[c - \'a\'] == null){\n                    node.next[c - \'a\'] = new TrieNode();\n                }\n                node = node.next[c - \'a\'];\n            }\n            node.isWord = true;\n        }\n        return root;\n    }\n    \n    class TrieNode{\n        TrieNode[] next = new TrieNode[26];\n        boolean isWord;\n    }\n\n```
[]