C++ Simple Solution using substr()
\nclass Solution {\npublic:\n    int countPrefixes(vector<string>& words, string s) {\n        int n = words.size();\n        int cnt = 0;\n        for(int i=0;
```\nclass Solution {\npublic:\n    int countPrefixes(vector<string>& words, string s) {\n        int n = words.size();\n        int cnt = 0;\n        for(int i=0; i<n; i++) {\n            string str = words[i];\n            if(str == s.substr(0, str.size())) cnt++;\n        }\n        return cnt;\n    }\n};\n```
['String', 'C']