C# HashSet + WordBreak
\npublic class Solution {\n    public IList<string> FindAllConcatenatedWordsInADict(string[] words) {\n        var result = new List<string>();\n        if (wor
```\npublic class Solution {\n    public IList<string> FindAllConcatenatedWordsInADict(string[] words) {\n        var result = new List<string>();\n        if (words.Length <= 2) return result;\n\n        var wordSet = new HashSet<string>(words);\n        foreach (var word in words) {\n            if (word == "") continue;\n\n            wordSet.Remove(word);\n\n            var canBreak = WordBreak(word, wordSet);\n\n            if (canBreak) result.Add(word);\n            wordSet.Add(word);\n        }\n\n        return result;\n    }\n\n    private bool WordBreak(string s, HashSet<string> dict) {\n        if (s.Length == 0) return false;\n\n        var n = s.Length;\n        var dp = new bool[n + 1];\n        dp[n] = true;\n\n        for (int i = n - 1; i >= 0; --i) {\n            for (int j = i; j < n; ++j) {\n                if (dp[j + 1] && dict.Contains(s.Substring(i, j - i + 1))) {\n                    dp[i] = true;\n                    break;\n                }\n            }\n        }\n\n        return dp[0];\n    }\n}\n```
[]