mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-07 00:11:41 +08:00
移除零宽空格
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
"boundTopicId": 1142,
|
||||
"title": "Regular Expression Matching",
|
||||
"titleSlug": "regular-expression-matching",
|
||||
"content": "<p>Given an input string <code>s</code> and a pattern <code>p</code>, implement regular expression matching with support for <code>'.'</code> and <code>'*'</code> where:</p>\n\n<ul>\n\t<li><code>'.'</code> Matches any single character.</li>\n\t<li><code>'*'</code> Matches zero or more of the preceding element.</li>\n</ul>\n\n<p>The matching should cover the <strong>entire</strong> input string (not partial).</p>\n\n<p> </p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> s = "aa", p = "a"\n<strong>Output:</strong> false\n<strong>Explanation:</strong> "a" does not match the entire string "aa".\n</pre>\n\n<p><strong class=\"example\">Example 2:</strong></p>\n\n<pre>\n<strong>Input:</strong> s = "aa", p = "a*"\n<strong>Output:</strong> true\n<strong>Explanation:</strong> '*' means zero or more of the preceding element, 'a'. Therefore, by repeating 'a' once, it becomes "aa".\n</pre>\n\n<p><strong class=\"example\">Example 3:</strong></p>\n\n<pre>\n<strong>Input:</strong> s = "ab", p = ".*"\n<strong>Output:</strong> true\n<strong>Explanation:</strong> ".*" means "zero or more (*) of any character (.)".\n</pre>\n\n<p> </p>\n<p><strong>Constraints:</strong></p>\n\n<ul>\n\t<li><code>1 <= s.length <= 20</code></li>\n\t<li><code>1 <= p.length <= 20</code></li>\n\t<li><code>s</code> contains only lowercase English letters.</li>\n\t<li><code>p</code> contains only lowercase English letters, <code>'.'</code>, and <code>'*'</code>.</li>\n\t<li>It is guaranteed for each appearance of the character <code>'*'</code>, there will be a previous valid character to match.</li>\n</ul>\n",
|
||||
"content": "<p>Given an input string <code>s</code> and a pattern <code>p</code>, implement regular expression matching with support for <code>'.'</code> and <code>'*'</code> where:</p>\n\n<ul>\n\t<li><code>'.'</code> Matches any single character.</li>\n\t<li><code>'*'</code> Matches zero or more of the preceding element.</li>\n</ul>\n\n<p>The matching should cover the <strong>entire</strong> input string (not partial).</p>\n\n<p> </p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> s = "aa", p = "a"\n<strong>Output:</strong> false\n<strong>Explanation:</strong> "a" does not match the entire string "aa".\n</pre>\n\n<p><strong class=\"example\">Example 2:</strong></p>\n\n<pre>\n<strong>Input:</strong> s = "aa", p = "a*"\n<strong>Output:</strong> true\n<strong>Explanation:</strong> '*' means zero or more of the preceding element, 'a'. Therefore, by repeating 'a' once, it becomes "aa".\n</pre>\n\n<p><strong class=\"example\">Example 3:</strong></p>\n\n<pre>\n<strong>Input:</strong> s = "ab", p = ".*"\n<strong>Output:</strong> true\n<strong>Explanation:</strong> ".*" means "zero or more (*) of any character (.)".\n</pre>\n\n<p> </p>\n<p><strong>Constraints:</strong></p>\n\n<ul>\n\t<li><code>1 <= s.length <= 20</code></li>\n\t<li><code>1 <= p.length <= 20</code></li>\n\t<li><code>s</code> contains only lowercase English letters.</li>\n\t<li><code>p</code> contains only lowercase English letters, <code>'.'</code>, and <code>'*'</code>.</li>\n\t<li>It is guaranteed for each appearance of the character <code>'*'</code>, there will be a previous valid character to match.</li>\n</ul>\n",
|
||||
"translatedTitle": "正则表达式匹配",
|
||||
"translatedContent": "<p>给你一个字符串 <code>s</code> 和一个字符规律 <code>p</code>,请你来实现一个支持 <code>'.'</code> 和 <code>'*'</code> 的正则表达式匹配。</p>\n\n<ul>\n\t<li><code>'.'</code> 匹配任意单个字符</li>\n\t<li><code>'*'</code> 匹配零个或多个前面的那一个元素</li>\n</ul>\n\n<p>所谓匹配,是要涵盖 <strong>整个 </strong>字符串 <code>s</code> 的,而不是部分字符串。</p>\n \n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \"aa\", p = \"a\"\n<strong>输出:</strong>false\n<strong>解释:</strong>\"a\" 无法匹配 \"aa\" 整个字符串。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \"aa\", p = \"a*\"\n<strong>输出:</strong>true\n<strong>解释:</strong>因为 '*' 代表可以匹配零个或多个前面的那一个元素, 在这里前面的元素就是 'a'。因此,字符串 \"aa\" 可被视为 'a' 重复了一次。\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \"ab\", p = \".*\"\n<strong>输出:</strong>true\n<strong>解释:</strong>\".*\" 表示可匹配零个或多个('*')任意字符('.')。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= s.length <= 20</code></li>\n\t<li><code>1 <= p.length <= 20</code></li>\n\t<li><code>s</code> 只包含从 <code>a-z</code> 的小写字母。</li>\n\t<li><code>p</code> 只包含从 <code>a-z</code> 的小写字母,以及字符 <code>.</code> 和 <code>*</code>。</li>\n\t<li>保证每次出现字符 <code>*</code> 时,前面都匹配到有效的字符</li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
|
Reference in New Issue
Block a user