1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-04 06:51:41 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

存量题库数据更新

This commit is contained in:
2023-12-09 18:42:21 +08:00
parent a788808cd7
commit c198538f10
10843 changed files with 288489 additions and 248355 deletions

View File

@@ -1,56 +1,47 @@
<p>一个字符串&nbsp;(<code>s</code>) 和一个字符模式&nbsp;(<code>p</code>) ,实现一个支持&nbsp;<code>&#39;?&#39;</code>&nbsp;&nbsp;<code>&#39;*&#39;</code>&nbsp;的通配符匹配</p>
<pre>&#39;?&#39; 可以匹配任何单个字符。
&#39;*&#39; 可以匹配任意字符串(包括空字符串)。
</pre>
<p>两个字符串<strong>完全匹配</strong>才算匹配成功。</p>
<p><strong>说明:</strong></p>
<div class="title__3Vvk">一个输入字符串 (<code>s</code>) 和一个字符模式 (<code>p</code>) 请你实现一个支持 <code>'?'</code><code>'*'</code> 匹配规则的通配符匹配</div>
<ul>
<li><code>s</code>&nbsp;可能为空,且只包含从&nbsp;<code>a-z</code>&nbsp;的小写字母</li>
<li><code>p</code>&nbsp;可能为空,且只包含从&nbsp;<code>a-z</code>&nbsp;的小写字母,以及字符&nbsp;<code>?</code>&nbsp;&nbsp;<code>*</code></li>
<li class="title__3Vvk"><code>'?'</code> 可以匹配任何单个字符</li>
<li class="title__3Vvk"><code>'*'</code> 可以匹配任意字符序列(包括空字符序列)</li>
</ul>
<p><strong>示例&nbsp;1:</strong></p>
<div class="original__bRMd">
<div>
<p>判定匹配成功的充要条件是:字符模式必须能够 <strong>完全匹配</strong> 输入字符串(而不是部分匹配)。</p>
</div>
</div>
&nbsp;
<pre><strong>输入:</strong>
s = &quot;aa&quot;
p = &quot;a&quot;
<strong>输出:</strong> false
<strong>解释:</strong> &quot;a&quot; 无法匹配 &quot;aa&quot; 整个字符串。</pre>
<p><strong class="example">示例 1</strong></p>
<p><strong>示例&nbsp;2:</strong></p>
<pre><strong>入:</strong>
s = &quot;aa&quot;
p = &quot;*&quot;
<strong>输出:</strong> true
<strong>解释:</strong>&nbsp;&#39;*&#39; 可以匹配任意字符串。
<pre>
<strong>输入:</strong>s = "aa", p = "a"
<strong>出:</strong>false
<strong>解释:</strong>"a" 无法匹配 "aa" 整个字符串。
</pre>
<p><strong>示例&nbsp;3:</strong></p>
<p><strong class="example">示例 2</strong></p>
<pre><strong>输入:</strong>
s = &quot;cb&quot;
p = &quot;?a&quot;
<strong>输出:</strong> false
<strong>解释:</strong>&nbsp;&#39;?&#39; 可以匹配 &#39;c&#39;, 但第二个 &#39;a&#39; 无法匹配 &#39;b&#39;
<pre>
<strong>输入:</strong>s = "aa", p = "*"
<strong>输出:</strong>true
<strong>解释:</strong>'*' 可以匹配任意字符串。
</pre>
<p><strong>示例&nbsp;4:</strong></p>
<p><strong class="example">示例 3</strong></p>
<pre><strong>输入:</strong>
s = &quot;adceb&quot;
p = &quot;*a*b&quot;
<strong>输出:</strong> true
<strong>解释:</strong>&nbsp;第一个 &#39;*&#39; 可以匹配空字符串, 第二个 &#39;*&#39; 可以匹配字符串 &quot;dce&quot;.
<pre>
<strong>输入:</strong>s = "cb", p = "?a"
<strong>输出:</strong>false
<strong>解释:</strong>'?' 可以匹配 'c', 但第二个 'a' 无法匹配 'b'。
</pre>
<p><strong>示例&nbsp;5:</strong></p>
<p>&nbsp;</p>
<pre><strong>输入:</strong>
s = &quot;acdcb&quot;
p = &quot;a*c?b&quot;
<strong>输出:</strong> false</pre>
<p><strong>提示:</strong></p>
<ul>
<li><code>0 &lt;= s.length, p.length &lt;= 2000</code></li>
<li><code>s</code> 仅由小写英文字母组成</li>
<li><code>p</code> 仅由小写英文字母、<code>'?'</code><code>'*'</code> 组成</li>
</ul>