mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-11 18:31:41 +08:00
存量题库数据更新
This commit is contained in:
@@ -1,29 +1,25 @@
|
||||
<p>给定一个字符串 <code>s</code><strong> </strong>和一个字符串 <code>t</code> ,计算在 <code>s</code> 的子序列中 <code>t</code> 出现的个数。</p>
|
||||
<p>给你两个字符串 <code>s</code><strong> </strong>和 <code>t</code> ,统计并返回在 <code>s</code> 的 <strong>子序列</strong> 中 <code>t</code> 出现的个数,结果需要对 10<sup>9</sup> + 7 取模。</p>
|
||||
|
||||
<p>字符串的一个 <strong>子序列</strong> 是指,通过删除一些(也可以不删除)字符且不干扰剩余字符相对位置所组成的新字符串。(例如,<code>"ACE"</code> 是 <code>"ABCDE"</code> 的一个子序列,而 <code>"AEC"</code> 不是)</p>
|
||||
<p> </p>
|
||||
|
||||
<p>题目数据保证答案符合 32 位带符号整数范围。</p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
<p><strong>示例 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong>s = "rabbbit", t = "rabbit"<code>
|
||||
<strong>输出</strong></code><strong>:</strong><code>3
|
||||
</code><strong>解释:</strong>
|
||||
如下图所示, 有 3 种可以从 s 中得到 <code>"rabbit" 的方案</code>。
|
||||
如下所示, 有 3 种可以从 s 中得到 <code>"rabbit" 的方案</code>。
|
||||
<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>示例 2:</strong></p>
|
||||
<p><strong>示例 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong>s = "babgbag", t = "bag"
|
||||
<code><strong>输出</strong></code><strong>:</strong><code>5
|
||||
</code><strong>解释:</strong>
|
||||
如下图所示, 有 5 种可以从 s 中得到 <code>"bag" 的方案</code>。
|
||||
如下所示, 有 5 种可以从 s 中得到 <code>"bag" 的方案</code>。
|
||||
<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>
|
||||
@@ -31,11 +27,11 @@
|
||||
<code>babg<strong><u>bag</u></strong></code>
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
|
||||
<p><strong>提示:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>0 <= s.length, t.length <= 1000</code></li>
|
||||
<li><code>1 <= s.length, t.length <= 1000</code></li>
|
||||
<li><code>s</code> 和 <code>t</code> 由英文字母组成</li>
|
||||
</ul>
|
||||
|
Reference in New Issue
Block a user