mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-03 22:42:52 +08:00
存量题库数据更新
This commit is contained in:
@@ -1,29 +1,27 @@
|
||||
<p>Given two strings <code>s</code> and <code>t</code>, return <em>the number of distinct subsequences of <code>s</code> which equals <code>t</code></em>.</p>
|
||||
|
||||
<p>A string's <strong>subsequence</strong> is a new string formed from the original string by deleting some (can be none) of the characters without disturbing the remaining characters' relative positions. (i.e., <code>"ACE"</code> is a subsequence of <code>"ABCDE"</code> while <code>"AEC"</code> is not).</p>
|
||||
<p>Given two strings s and t, return <i>the number of distinct</i> <b><i>subsequences</i></b><i> of </i>s<i> which equals </i>t.</p>
|
||||
|
||||
<p>The test cases are generated so that the answer fits on a 32-bit signed integer.</p>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Example 1:</strong></p>
|
||||
<p><strong class="example">Example 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> s = "rabbbit", t = "rabbit"
|
||||
<strong>Output:</strong> 3
|
||||
<strong>Explanation:</strong>
|
||||
As shown below, there are 3 ways you can generate "rabbit" from S.
|
||||
As shown below, there are 3 ways you can generate "rabbit" from s.
|
||||
<code><strong><u>rabb</u></strong>b<strong><u>it</u></strong></code>
|
||||
<code><strong><u>ra</u></strong>b<strong><u>bbit</u></strong></code>
|
||||
<code><strong><u>rab</u></strong>b<strong><u>bit</u></strong></code>
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 2:</strong></p>
|
||||
<p><strong class="example">Example 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> s = "babgbag", t = "bag"
|
||||
<strong>Output:</strong> 5
|
||||
<strong>Explanation:</strong>
|
||||
As shown below, there are 5 ways you can generate "bag" from S.
|
||||
As shown below, there are 5 ways you can generate "bag" from s.
|
||||
<code><strong><u>ba</u></strong>b<u><strong>g</strong></u>bag</code>
|
||||
<code><strong><u>ba</u></strong>bgba<strong><u>g</u></strong></code>
|
||||
<code><u><strong>b</strong></u>abgb<strong><u>ag</u></strong></code>
|
||||
|
Reference in New Issue
Block a user