simple solution
\nclass Solution {\n    bool check(string &s , string &p){\n          if(s.length() < p.length())\n              return false;\n          int i = 0;\n        fo
```\nclass Solution {\n    bool check(string &s , string &p){\n          if(s.length() < p.length())\n              return false;\n          int i = 0;\n        for(i = 0 ; i < p.length() ; i++){\n           if(p[i] != s[i])\n               return false;\n        }\n        return true;\n    }\npublic:\n    int prefixCount(vector<string>& words, string pref) {\n        int cnt = 0;\n        int n = words.size();\n        for(int i = 0 ; i < n ; i++){\n           if(check(words[i] , pref))\n               cnt++;\n        }\n        return cnt;\n    }\n};\n```
['C++']