
[LeetCode] 2185. Counting Words With a Given Prefix (Python)
·
알고리즘/LeetCode
난이도: Easy 문제 설명You are given an array of strings words and a string pref. Return the number of strings in words that contain pref as a prefix. A prefix of a string s is any leading contiguous substring of s. 문제 예제Example 1:Input: words = ["pay","attention","practice","attend"],pref= "at"Output: 2Explanation: The 2 strings that contain "at" as a prefix are: "attention" and "attend".Example 2:Inpu..