0MS 🥇|| BEATS 100% 🥂 || 5 LINE CODE ⛳ || 🌟JAVA ☕
Code
![Screenshot 2025-01-11 154428.png](https://assets.leetcode.com/users/images/f03b73f2-83d3-4e96-b4fb-bc566f531f16_1737178088.854509.png)


# Code
```java []
class Solution {
    public int countPrefixes(String[] words, String s) {
        int ans = 0;

        for (String word : words) {
            if (s.startsWith(word)) {
                ans++;
            }
        }

        return ans;
    }
}
```


['Java']