Simple using Find function Beats 100%.
IntuitionHey,as we know the find function returns the first occurence of a pattern in a string.ApproachWe iterate over each word and use the find function if th
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
Hey,as we know the find function returns the first occurence of a pattern in a string.

# Approach
<!-- Describe your approach to solving the problem. -->
We iterate over each word and use the find function if the first occurence is 0 we increment the count.
# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
O(n*m) as find function is involved.
- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
O(1)
# Code
```cpp []
class Solution {
public:
    int prefixCount(vector<string>& words, string pref) {
        int c=0;
        for(int i=0;i<words.size();i++)
        {
            if(words[i].find(pref)==0)
             c++;
        }
        return c;
    }
};
```
['C++']