[Python3] Brute Force - Simple Solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n##### 1. Brute-Force\n```\nclass Solution:\n    def prefixCount(self, words: List[str], pref: str) -> int:\n        m = len(pref)\n        cnt = 0\n        for word in words:\n            if word[:m] == pref: cnt += 1\n        return cnt\n```\n\n- Time complexity: $$O(N * M)$$ with `N` is length of `words` and `M` is length of `pref`\n\n- Space complexity: $$O(1)$$\n\n##### 2. 1-line\n```\nclass Solution:\n    def prefixCount(self, words: List[str], pref: str) -> int:\n        return sum(1 for word in words if word.startswith(pref))\n```\n- Time complexity: $$O(N * M)$$ with `N` is length of `words` and `M` is length of `pref`\n\n- Space complexity: $$O(1)$$
['Array', 'String', 'String Matching', 'Python3']