Skip to content

Commit 9db301f

Browse files
committedApr 14, 2021
Create README - LeetHub
1 parent 70fd411 commit 9db301f

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
 
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<h2>792. Number of Matching Subsequences</h2><h3>Medium</h3><hr><div><p>Given a string <code>s</code> and an array of strings <code>words</code>, return <em>the number of</em> <code>words[i]</code> <em>that is a subsequence of</em> <code>s</code>.</p>
2+
3+
<p>A <strong>subsequence</strong> 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.</p>
4+
5+
<ul>
6+
<li>For example, <code>"ace"</code> is a subsequence of <code>"abcde"</code>.</li>
7+
</ul>
8+
9+
<p>&nbsp;</p>
10+
<p><strong>Example 1:</strong></p>
11+
12+
<pre><strong>Input:</strong> s = "abcde", words = ["a","bb","acd","ace"]
13+
<strong>Output:</strong> 3
14+
<strong>Explanation:</strong> There are three strings in words that are a subsequence of s: "a", "acd", "ace".
15+
</pre>
16+
17+
<p><strong>Example 2:</strong></p>
18+
19+
<pre><strong>Input:</strong> s = "dsahjpjauf", words = ["ahjpjau","ja","ahbwzgqnuk","tnmlanowax"]
20+
<strong>Output:</strong> 2
21+
</pre>
22+
23+
<p>&nbsp;</p>
24+
<p><strong>Constraints:</strong></p>
25+
26+
<ul>
27+
<li><code>1 &lt;= s.length &lt;= 5 * 10<sup>4</sup></code></li>
28+
<li><code>1 &lt;= words.length &lt;= 5000</code></li>
29+
<li><code>1 &lt;= words[i].length &lt;= 50</code></li>
30+
<li><code>s</code> and <code>words[i]</code> consist of only lowercase English letters.</li>
31+
</ul>
32+
</div>

0 commit comments

Comments
 (0)