国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

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

leetcode 792. Number of Matching Subsequences

2022-12-24 13:16 作者:您是打尖兒還是住店呢  | 我要投稿


Medium

Given a string?s?and an array of strings?words, return?the number of?words[i]?that is a subsequence of?s.

A?subsequence?of a string is a new string generated from the original string with some characters (can be none) deleted without changing the relative order of the remaining characters.

  • For example,?"ace"?is a subsequence of?"abcde".

?

Example 1:

Input: s = "abcde", words = ["a","bb","acd","ace"]Output: 3Explanation: There are three strings in words that are a subsequence of s: "a", "acd", "ace".

Example 2:

Input: s = "dsahjpjauf", words = ["ahjpjau","ja","ahbwzgqnuk","tnmlanowax"]Output: 2

?

Constraints:

  • 1 <= s.length <= 5 * 104

  • 1 <= words.length <= 5000

  • 1 <= words[i].length <= 50

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

用map就超時(shí),set就可以,真的是遇得到。。。


Java

Runtime124 ms

Beats

72.89%

Memory43.3 MB

Beats

95.29%


leetcode 792. Number of Matching Subsequences的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
富蕴县| 桐庐县| 都匀市| 孙吴县| 玉溪市| 郓城县| 迁安市| 遂昌县| 崇义县| 乳山市| 平定县| 楚雄市| 普定县| 买车| 萨嘎县| 河西区| 丹寨县| 油尖旺区| 漾濞| 清徐县| 泸定县| 望城县| 新郑市| 缙云县| 舒兰市| 广河县| 晴隆县| 平远县| 屯昌县| 凌云县| 宁都县| 郎溪县| 桃园市| 岳池县| 龙南县| 莲花县| 区。| 宁乡县| 凉城县| 浙江省| 黄骅市|