ads;
Complexity
Time complexity:
O(N*M)
N= no.ele in words array
M=length of pref string

Space complexity:
O(1)
Code
# Complexity
- Time complexity:
O(N*M)
N= no.ele in words array
M=length of pref string 
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
O(1)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```cpp []
class Solution {
public:
    int prefixCount(vector<string>& words, string pref) {
    int n=words.size();
    int count=0;
    for(int i=0;i<n;i++){
        string word=words[i];
        if(word.find(pref)==0) count++;
    }  
    return count;
    }
};
```
['C++']