无码av一区二区三区无码,在线观看老湿视频福利,日韩经典三级片,成 人色 网 站 欧美大片在线观看

歡迎光臨散文網(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ó)家法律
浮山县| 资阳市| 萨迦县| 杂多县| 金秀| 达尔| 河源市| 建湖县| 莱州市| 宁河县| 高碑店市| 罗平县| 清河县| 南和县| 定兴县| 屯昌县| 柘城县| 元阳县| 双柏县| 崇文区| 怀柔区| 吕梁市| 胶州市| 财经| 枣庄市| 彭水| 江门市| 丰原市| 上思县| 珲春市| 波密县| 民丰县| 济源市| 库车县| 时尚| 克东县| 淳化县| 喀什市| 碌曲县| 连山| 桐柏县|