C++ || Easy Video Solution
The video solution for the below code is\nhttps://youtu.be/uASs_VIFnjI\n\n# Code\ncpp []\nclass Solution {\nprivate:\n    bool helper(string word, unordered_set
The video solution for the below code is\nhttps://youtu.be/uASs_VIFnjI\n\n# Code\n```cpp []\nclass Solution {\nprivate:\n    bool helper(string word, unordered_set<char> &us){\n        bool ans = true;\n        for(auto &ch : word){\n            ans = ans && (us.find(ch) != us.end());\n        }\n        return ans;\n    }\npublic:\n    int countConsistentStrings(string allowed, vector<string>& words) {\n        ios_base::sync_with_stdio(false);\n        cin.tie(NULL);\n        cout.tie(NULL);\n        // Note:\n        // String allowed consists of distinct characters.\n        // Given an array of words\n        // we can a string consisitent if all the characters appear in the string allowed\n        // We need to find out how many words of given vector are consistent.\n        // allowed = ab\n        // ad, bd, [aaab], [baa], dadab\n        int ans = 0;\n        unordered_set<char> us;\n        for(auto &ch : allowed) us.insert(ch);\n        for(auto &word : words) {\n            ans += helper(word, us);\n        }\n        return ans;\n    }\n};\n```
['C++']