✅ fast C++ code
Solution Code\nC++ []\nclass Solution {\npublic:\n    vector<string> findAllConcatenatedWordsInADict(vector<string>& words) {\n        unordered_set<string> wor
# Solution Code\n``` C++ []\nclass Solution {\npublic:\n    vector<string> findAllConcatenatedWordsInADict(vector<string>& words) {\n        unordered_set<string> words_set;\n        for (string word : words) words_set.insert(word);\n        vector<string> res;\n    \n        for (string word : words) {\n            int n = word.size();\n            vector<int> dp(n + 1, 0);\n            dp[0] = 1;\n            for (int i = 0; i < n; i++) {\n                if (!dp[i]) continue;\n                for (int j = i + 1; j <= n; j++) {\n                    if (j - i < n && words_set.count(word.substr(i, j - i))) {\n                        dp[j] = 1;\n                    }\n                }\n                if (dp[n]) {\n                    res.push_back(word);\n                    break;\n                }\n            }\n        }\n        return res;\n    }\n};\n```\n\n![kitty.jpeg](https://assets.leetcode.com/users/images/18059b71-18b6-4d9e-8c8a-eb5e64f636fa_1674813837.6846375.jpeg)\n
['C++']