My simple Java Solution using DP. No sort.
\nclass Solution {\n    public List<String> findAllConcatenatedWordsInADict(String[] words) {\n        List<String> result = new ArrayList<>();\n        Set<Str
```\nclass Solution {\n    public List<String> findAllConcatenatedWordsInADict(String[] words) {\n        List<String> result = new ArrayList<>();\n        Set<String> set = new HashSet<>();\n        for(String word: words)\n            set.add(word);\n        for(String word: words){\n            if(helper(word, set)){\n                result.add(word);\n            }\n        }\n        return result;\n    }\n    private boolean helper(String s, Set<String> set){\n        int len = s.length();\n        if(len == 0)\n            return false;\n        boolean[] dp = new boolean[len + 1];\n        dp[0] = true;\n        for(int i = 0; i <= len; i++){\n            for(int j = i - 1 ; j >= 0; j--){ // running this loop in the backwards direction saves time\n                if(i == len && j == 0) // we can\'t consider the string to be made up of itself i.e we ignore s.substring(0, len)\n                    continue;\n                if(dp[j] && set.contains(s.substring(j,i))){\n                    dp[i] = true;\n                    break;\n                }                \n            }\n        }\n        return dp[len];\n    }\n}\n```\nThe time complexity of this solution is O( N * len^3) were N is the size of words array and len is the length of the string
['Dynamic Programming', 'Java']