c++ solution using substr
\'\'\'\nclass Solution {\npublic:\n    int prefixCount(vector& words, string pref) {\n        int ans=0;\n        for(auto x:words){\n            if(x.substr(0,
\'\'\'\nclass Solution {\npublic:\n    int prefixCount(vector<string>& words, string pref) {\n        int ans=0;\n        for(auto x:words){\n            if(x.substr(0,pref.size()) == pref)\n            {\n                ans++;\n            }\n        }\n        return ans;\n    }\n};
['String', 'C', 'C++']