[C++] Simple Solution
Code
# Code
```cpp []
class Solution {
public:
    int countPrefixes(vector<string>& words, string s) {
        unordered_set<string> hs;
        for(int i=1; i<=s.size(); i++) {
            hs.insert(s.substr(0, i));
        }

        int ans = 0;
        for(auto w : words) {
            if(hs.count(w)) ans++;
        }

        return ans;
    }
};
```
['C++']