2255. Count Prefixes of a Given String
Easy
You are given a string array words
and a string s
, where words[i]
and s
comprise only of lowercase English letters.
Return the number of strings in words
that are a prefix of s
.
A prefix of a string is a substring that occurs at the beginning of the string. A substring is a contiguous sequence of characters within a string.
Example 1:
Example 2:
Constraints:
1 <= words.length <= 1000
1 <= words[i].length, s.length <= 10
words[i]
ands
consist of lowercase English letters only.
解題
Last updated