五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

LeetCode 2255. Count Prefixes of a Given String

2023-01-28 16:43 作者:您是打尖兒還是住店呢  | 我要投稿

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:

Input: words = ["a","b","c","ab","bc","abc"], s = "abc"Output: 3Explanation:The strings in words which are a prefix of s = "abc" are: "a", "ab", and "abc". Thus the number of strings in words which are a prefix of s is 3.

Example 2:

Input: words = ["a","a"], s = "aa"Output: 2Explanation:Both of the strings are a prefix of s. Note that the same string can occur multiple times in words, and it should be counted each time.

?

Constraints:

  • 1 <= words.length <= 1000

  • 1 <= words[i].length, s.length <= 10

  • words[i]?and?s?consist of lowercase English letters?only.

Accepted

35,725

Submissions

48,867

能上路就行;跑的慢點(diǎn)就慢點(diǎn)了。。。

Runtime:?3 ms, faster than?22.72%?of?Java?online submissions for?Count Prefixes of a Given String.

Memory Usage:?44.4 MB, less than?6.85%?of?Java?online submissions for?Count Prefixes of a Given String.


LeetCode 2255. Count Prefixes of a Given String的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
安义县| 兴山县| 会同县| 尤溪县| 宜川县| 封丘县| 莱阳市| 泌阳县| 湘乡市| 浠水县| 修武县| 吉安市| 缙云县| 肥西县| 泸州市| 涞源县| 卓资县| 盖州市| 湘西| 阳江市| 拉萨市| 彰化市| 谢通门县| 蒲城县| 广安市| 郓城县| 凤城市| 饶河县| 香河县| 盐津县| 广水市| 安新县| 蒙城县| 嘉义市| 来凤县| 星座| 改则县| 怀宁县| 靖边县| 烟台市| 延津县|