C++ solution
\nclass Solution {\npublic:\n    int countPrefixes(vector<string>& words, string s) {\n        int ct=0;\n        for(string&word:words){\n          bool flag=t
```\nclass Solution {\npublic:\n    int countPrefixes(vector<string>& words, string s) {\n        int ct=0;\n        for(string&word:words){\n          bool flag=true;\n          if(word.length()<=s.length()){\n             for(int i=0; i<min(word.length(),s.length()); ++i){\n                if(word[i]!=s[i]){\n                   flag=false;\n                   break;\n                }\n             }\n            flag?ct++:ct+=0;\n          }\n        }\n        return ct;\n    }\n};\n```
[]