2 BEST C++ solutions || Hash-table/Hash set and array approach
Code\n\n// Solution 1 (Array)\nclass Solution {\npublic:\n    int countConsistentStrings(string allowed, vector<string>& words) {\n        int ans = words.size(
# Code\n```\n// Solution 1 (Array)\nclass Solution {\npublic:\n    int countConsistentStrings(string allowed, vector<string>& words) {\n        int ans = words.size();\n        bool letter[26] = {};\n        for (char c: allowed) \n            letter[c - \'a\'] = true;\n        for (string word: words) {\n            for (char c: word){ \n                if (!letter[c - \'a\']){\n                    ans--;\n                    break;\n                }\n            }\n        }\n        return ans;\n    }\n};\n\n// Solution 2 (Hash set)\nclass Solution {\npublic:\n    int countConsistentStrings(string allowed, vector<string>& words) {\n        unordered_set<char> letter;\n        for(int i=0; i<allowed.size(); i++)\n            letter.insert(allowed[i]);\n        int ans = words.size();\n        for(auto word : words){\n            for(auto i : word){\n                if(letter.find(i) == letter.end()){\n                    ans--;\n                    break;\n                }\n            }\n        }\n        return ans;\n    }\n};\n```
['Array', 'Hash Table', 'C++']