C++ || Easy O(NxS) solution || String
\nclass Solution {\npublic:\n    //iterate over each words[i] and take the sub-string str from s of size equals to words[i].\n    //and compare str with words[i
```\nclass Solution {\npublic:\n    //iterate over each words[i] and take the sub-string str from s of size equals to words[i].\n    //and compare str with words[i] if both are equal increase count by 1.\n    int countPrefixes(vector<string>& words, string s) \n    {\n        int count=0;\n        for(auto it: words)\n        {\n            string str = s.substr(0, it.size());\n            if(str == it) count++;            \n        }\n        return count;        \n    }\n};\n```
['String', 'C', 'Iterator', 'C++']