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

移除零宽空格

This commit is contained in:
2025-05-25 15:06:02 +08:00
parent 59597532bc
commit 3070bed723
272 changed files with 1031 additions and 749 deletions

View File

@@ -9,7 +9,7 @@
"titleSlug": "equal-rational-numbers",
"content": "<p>Given two strings <code>s</code> and <code>t</code>, each of which represents a non-negative rational number, return <code>true</code> if and only if they represent the same number. The strings may use parentheses to denote the repeating part of the rational number.</p>\n\n<p>A <strong>rational number</strong> can be represented using up to three parts: <code>&lt;IntegerPart&gt;</code>, <code>&lt;NonRepeatingPart&gt;</code>, and a <code>&lt;RepeatingPart&gt;</code>. The number will be represented in one of the following three ways:</p>\n\n<ul>\n\t<li><code>&lt;IntegerPart&gt;</code>\n\n\t<ul>\n\t\t<li>For example, <code>12</code>, <code>0</code>, and <code>123</code>.</li>\n\t</ul>\n\t</li>\n\t<li><code>&lt;IntegerPart&gt;<strong>&lt;.&gt;</strong>&lt;NonRepeatingPart&gt;</code>\n\t<ul>\n\t\t<li>For example, <code>0.5</code>, <code>1.</code>, <code>2.12</code>, and <code>123.0001</code>.</li>\n\t</ul>\n\t</li>\n\t<li><code>&lt;IntegerPart&gt;<strong>&lt;.&gt;</strong>&lt;NonRepeatingPart&gt;<strong>&lt;(&gt;</strong>&lt;RepeatingPart&gt;<strong>&lt;)&gt;</strong></code>\n\t<ul>\n\t\t<li>For example, <code>0.1(6)</code>, <code>1.(9)</code>, <code>123.00(1212)</code>.</li>\n\t</ul>\n\t</li>\n</ul>\n\n<p>The repeating portion of a decimal expansion is conventionally denoted within a pair of round brackets. For example:</p>\n\n<ul>\n\t<li><code>1/6 = 0.16666666... = 0.1(6) = 0.1666(6) = 0.166(66)</code>.</li>\n</ul>\n\n<p>&nbsp;</p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> s = &quot;0.(52)&quot;, t = &quot;0.5(25)&quot;\n<strong>Output:</strong> true\n<strong>Explanation:</strong> Because &quot;0.(52)&quot; represents 0.52525252..., and &quot;0.5(25)&quot; represents 0.52525252525..... , the strings represent the same number.\n</pre>\n\n<p><strong class=\"example\">Example 2:</strong></p>\n\n<pre>\n<strong>Input:</strong> s = &quot;0.1666(6)&quot;, t = &quot;0.166(66)&quot;\n<strong>Output:</strong> true\n</pre>\n\n<p><strong class=\"example\">Example 3:</strong></p>\n\n<pre>\n<strong>Input:</strong> s = &quot;0.9(9)&quot;, t = &quot;1.&quot;\n<strong>Output:</strong> true\n<strong>Explanation:</strong> &quot;0.9(9)&quot; represents 0.999999999... repeated forever, which equals 1. [<a href=\"https://en.wikipedia.org/wiki/0.999...\" target=\"_blank\">See this link for an explanation.</a>]\n&quot;1.&quot; represents the number 1, which is formed correctly: (IntegerPart) = &quot;1&quot; and (NonRepeatingPart) = &quot;&quot;.\n</pre>\n\n<p>&nbsp;</p>\n<p><strong>Constraints:</strong></p>\n\n<ul>\n\t<li>Each part consists only of digits.</li>\n\t<li>The <code>&lt;IntegerPart&gt;</code> does not have leading zeros (except for the zero itself).</li>\n\t<li><code>1 &lt;= &lt;IntegerPart&gt;.length &lt;= 4</code></li>\n\t<li><code>0 &lt;= &lt;NonRepeatingPart&gt;.length &lt;= 4</code></li>\n\t<li><code>1 &lt;= &lt;RepeatingPart&gt;.length &lt;= 4</code></li>\n</ul>\n",
"translatedTitle": "相等的有理数",
"translatedContent": "<p>给定两个字符串&nbsp;<code>s</code>&nbsp;和&nbsp;<code>t</code>&nbsp;,每个字符串代表一个非负有理数,只有当它们表示相同的数字时才返回 <code>true</code>&nbsp;。字符串中可以使用括号来表示有理数的重复部分。</p>\n\n<p><strong>有理数</strong>&nbsp;最多可以用三个部分来表示:<em>整数部分</em>&nbsp;<code>&lt;IntegerPart&gt;</code>、<em>小数非重复部分</em>&nbsp;<code>&lt;NonRepeatingPart&gt;</code>&nbsp;和<em>小数重复部分</em>&nbsp;<code>&lt;(&gt;&lt;RepeatingPart&gt;&lt;)&gt;</code>。数字可以用以下三种方法之一来表示:</p>\n\n<ul>\n\t<li><code>&lt;IntegerPart&gt;</code>&nbsp;\n\n\t<ul>\n\t\t<li>例:&nbsp;<code>0</code>&nbsp;,<code>12</code>&nbsp;和&nbsp;<code>123</code>&nbsp;</li>\n\t</ul>\n\t</li>\n\t<li><code>&lt;IntegerPart&gt;&lt;.&gt;&lt;NonRepeatingPart&gt;</code>\n\t<ul>\n\t\t<li>例: <code>0.5<font color=\"#333333\"><font face=\"Helvetica Neue, Helvetica, Arial, sans-serif\"><span style=\"font-size:14px\"><span style=\"background-color:#ffffff\">&nbsp;, </span></span></font></font></code><font color=\"#333333\"><font face=\"Helvetica Neue, Helvetica, Arial, sans-serif\"><span style=\"font-size:14px\"><span style=\"background-color:#ffffff\"><code>1.</code>&nbsp;,&nbsp;</span></span></font></font><code>2.12</code>&nbsp;和&nbsp;<code>123.0001</code></li>\n\t</ul>\n\t</li>\n\t<li><code>&lt;IntegerPart&gt;&lt;.&gt;&lt;NonRepeatingPart&gt;&lt;(&gt;&lt;RepeatingPart&gt;&lt;)&gt;</code>&nbsp;\n\t<ul>\n\t\t<li>例: <code>0.1(6)</code> <code>1.(9)</code> <code>123.00(1212)</code></li>\n\t</ul>\n\t</li>\n</ul>\n\n<p>十进制展开的重复部分通常在一对圆括号内表示。例如:</p>\n\n<ul>\n\t<li><code>1 / 6 = 0.16666666... = 0.1(6) = 0.1666(6) = 0.166(66)</code></li>\n</ul>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \"0.(52)\", t = \"0.5(25)\"\n<strong>输出:</strong>true\n<strong>解释:</strong>因为 \"0.(52)\" 代表 0.52525252...,而 \"0.5(25)\" 代表 0.52525252525.....,则这两个字符串表示相同的数字。\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \"0.1666(6)\", t = \"0.166(66)\"\n<strong>输出:</strong>true\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \"0.9(9)\", t = \"1.\"\n<strong>输出:</strong>true\n<strong>解释:</strong>\"0.9(9)\" 代表 0.999999999... 永远重复,等于 1 。[<a href=\"https://baike.baidu.com/item/0.999…/5615429?fr=aladdin\" target=\"_blank\">有关说明,请参阅此链接</a>]\n\"1.\" 表示数字 1其格式正确(IntegerPart) = \"1\" 且 (NonRepeatingPart) = \"\" 。</pre>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li>每个部分仅由数字组成。</li>\n\t<li>整数部分&nbsp;<code>&lt;IntegerPart&gt;</code>&nbsp;不会以零开头。(零本身除外)</li>\n\t<li><code>1 &lt;= &lt;IntegerPart&gt;.length &lt;= 4 </code></li>\n\t<li><code>0 &lt;= &lt;NonRepeatingPart&gt;.length &lt;= 4 </code></li>\n\t<li><code>1 &lt;= &lt;RepeatingPart&gt;.length &lt;= 4 </code></li>\n</ul>\n<span style=\"display:block\"><span style=\"height:0px\"><span style=\"position:absolute\"></span></span></span>",
"translatedContent": "<p>给定两个字符串&nbsp;<code>s</code>&nbsp;和&nbsp;<code>t</code>&nbsp;,每个字符串代表一个非负有理数,只有当它们表示相同的数字时才返回 <code>true</code>&nbsp;。字符串中可以使用括号来表示有理数的重复部分。</p>\n\n<p><strong>有理数</strong>&nbsp;最多可以用三个部分来表示:<em>整数部分</em>&nbsp;<code>&lt;IntegerPart&gt;</code>、<em>小数非重复部分</em>&nbsp;<code>&lt;NonRepeatingPart&gt;</code>&nbsp;和<em>小数重复部分</em>&nbsp;<code>&lt;(&gt;&lt;RepeatingPart&gt;&lt;)&gt;</code>。数字可以用以下三种方法之一来表示:</p>\n\n<ul>\n\t<li><code>&lt;IntegerPart&gt;</code>&nbsp;\n\n\t<ul>\n\t\t<li>例:&nbsp;<code>0</code>&nbsp;,<code>12</code>&nbsp;和&nbsp;<code>123</code>&nbsp;</li>\n\t</ul>\n\t</li>\n\t<li><code>&lt;IntegerPart&gt;&lt;.&gt;&lt;NonRepeatingPart&gt;</code>\n\t<ul>\n\t\t<li>例: <code>0.5<font color=\"#333333\"><font face=\"Helvetica Neue, Helvetica, Arial, sans-serif\"><span style=\"font-size:14px\"><span style=\"background-color:#ffffff\">&nbsp;, </span></span></font></font></code><font color=\"#333333\"><font face=\"Helvetica Neue, Helvetica, Arial, sans-serif\"><span style=\"font-size:14px\"><span style=\"background-color:#ffffff\"><code>1.</code>&nbsp;,&nbsp;</span></span></font></font><code>2.12</code>&nbsp;和&nbsp;<code>123.0001</code></li>\n\t</ul>\n\t</li>\n\t<li><code>&lt;IntegerPart&gt;&lt;.&gt;&lt;NonRepeatingPart&gt;&lt;(&gt;&lt;RepeatingPart&gt;&lt;)&gt;</code>&nbsp;\n\t<ul>\n\t\t<li>例: <code>0.1(6)</code> <code>1.(9)</code> <code>123.00(1212)</code></li>\n\t</ul>\n\t</li>\n</ul>\n\n<p>十进制展开的重复部分通常在一对圆括号内表示。例如:</p>\n\n<ul>\n\t<li><code>1 / 6 = 0.16666666... = 0.1(6) = 0.1666(6) = 0.166(66)</code></li>\n</ul>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \"0.(52)\", t = \"0.5(25)\"\n<strong>输出:</strong>true\n<strong>解释:</strong>因为 \"0.(52)\" 代表 0.52525252...,而 \"0.5(25)\" 代表 0.52525252525.....,则这两个字符串表示相同的数字。\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \"0.1666(6)\", t = \"0.166(66)\"\n<strong>输出:</strong>true\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \"0.9(9)\", t = \"1.\"\n<strong>输出:</strong>true\n<strong>解释:</strong>\"0.9(9)\" 代表 0.999999999... 永远重复,等于 1 。[<a href=\"https://baike.baidu.com/item/0.999…/5615429?fr=aladdin\" target=\"_blank\">有关说明,请参阅此链接</a>]\n\"1.\" 表示数字 1其格式正确(IntegerPart) = \"1\" 且 (NonRepeatingPart) = \"\" 。</pre>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li>每个部分仅由数字组成。</li>\n\t<li>整数部分&nbsp;<code>&lt;IntegerPart&gt;</code>&nbsp;不会以零开头。(零本身除外)</li>\n\t<li><code>1 &lt;= &lt;IntegerPart&gt;.length &lt;= 4 </code></li>\n\t<li><code>0 &lt;= &lt;NonRepeatingPart&gt;.length &lt;= 4 </code></li>\n\t<li><code>1 &lt;= &lt;RepeatingPart&gt;.length &lt;= 4 </code></li>\n</ul>\n<span style=\"display:block\"><span style=\"height:0px\"><span style=\"position:absolute\"></span></span></span>",
"isPaidOnly": false,
"difficulty": "Hard",
"likes": 34,