2255. Count Prefixes of a Given String
Complexity
Time complexity: O(M*N)

Space complexity: O(1)
Code
# Complexity
- Time complexity: O(M*N)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

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

# Code
```c []
int countPrefixes(char** words, int wordsSize, char* s) {
    int t, count = 0;
    for (int i = 0; i < wordsSize; i++) {
        t = 1;
        if (strlen(words[i]) <= strlen(s)) {

            for (int j = 0; j < strlen(words[i]); j++) {
                if (words[i][j] != s[j])
                    t = 0;
            }
            if (t)
                count++;
        }
    }
    return count;
}
```
['C']