Easy C++ Solution using Hash Maps
\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \nCreate a boolean Hash Map to kee
\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nCreate a boolean Hash Map to keep track of the allowed characters.\nThen, compare each character of the word with the created Hash Map.\n\n# Complexity\n- Time complexity: O(n*n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int countConsistentStrings(string allowed, vector<string>& words) {\n        bool arr[26]={0},flag=1;\n        std::string::iterator itr=allowed.begin();\n        while(itr!=allowed.end())\n        {\n            arr[*itr%26]=1;\n            itr++;\n        }\n        int t=0;\n        for(int i=0;i<words.size();i++)\n        {\n            itr=words[i].begin();\n            while(itr!=words[i].end())\n            {\n                if(arr[(*itr)%26]==0)\n                {\n                    flag=0;\n                    break;\n                }\n                itr++;\n            }\n            if(flag==1)\n                t++;\n            flag=1;\n        }\n        return t;\n    }\n};\n```
['C++']