2185. Counting Words With a Given Prefix
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:
Example 2:
Constraints:
1 <= words.length <= 100
1 <= words[i].length, pref.length <= 100
words[i]
andpref
consist of lowercase English letters.
Previous2181. Merge Nodes in Between ZerosNext2186. Minimum Number of Steps to Make Two Strings Anagram II
Last updated