mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-08 00:41:42 +08:00
移除零宽空格
This commit is contained in:
@@ -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><IntegerPart></code>, <code><NonRepeatingPart></code>, and a <code><RepeatingPart></code>. The number will be represented in one of the following three ways:</p>\n\n<ul>\n\t<li><code><IntegerPart></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><IntegerPart><strong><.></strong><NonRepeatingPart></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><IntegerPart><strong><.></strong><NonRepeatingPart><strong><(></strong><RepeatingPart><strong><)></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> </p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> s = "0.(52)", t = "0.5(25)"\n<strong>Output:</strong> true\n<strong>Explanation:</strong> Because "0.(52)" represents 0.52525252..., and "0.5(25)" 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 = "0.1666(6)", t = "0.166(66)"\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 = "0.9(9)", t = "1."\n<strong>Output:</strong> true\n<strong>Explanation:</strong> "0.9(9)" 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"1." represents the number 1, which is formed correctly: (IntegerPart) = "1" and (NonRepeatingPart) = "".\n</pre>\n\n<p> </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><IntegerPart></code> does not have leading zeros (except for the zero itself).</li>\n\t<li><code>1 <= <IntegerPart>.length <= 4</code></li>\n\t<li><code>0 <= <NonRepeatingPart>.length <= 4</code></li>\n\t<li><code>1 <= <RepeatingPart>.length <= 4</code></li>\n</ul>\n",
|
||||
"translatedTitle": "相等的有理数",
|
||||
"translatedContent": "<p>给定两个字符串 <code>s</code> 和 <code>t</code> ,每个字符串代表一个非负有理数,只有当它们表示相同的数字时才返回 <code>true</code> 。字符串中可以使用括号来表示有理数的重复部分。</p>\n\n<p><strong>有理数</strong> 最多可以用三个部分来表示:<em>整数部分</em> <code><IntegerPart></code>、<em>小数非重复部分</em> <code><NonRepeatingPart></code> 和<em>小数重复部分</em> <code><(><RepeatingPart><)></code>。数字可以用以下三种方法之一来表示:</p>\n\n<ul>\n\t<li><code><IntegerPart></code> \n\n\t<ul>\n\t\t<li>例: <code>0</code> ,<code>12</code> 和 <code>123</code> </li>\n\t</ul>\n\t</li>\n\t<li><code><IntegerPart><.><NonRepeatingPart></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\"> , </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> , </span></span></font></font><code>2.12</code> 和 <code>123.0001</code></li>\n\t</ul>\n\t</li>\n\t<li><code><IntegerPart><.><NonRepeatingPart><(><RepeatingPart><)></code> \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> </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> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li>每个部分仅由数字组成。</li>\n\t<li>整数部分 <code><IntegerPart></code> 不会以零开头。(零本身除外)</li>\n\t<li><code>1 <= <IntegerPart>.length <= 4 </code></li>\n\t<li><code>0 <= <NonRepeatingPart>.length <= 4 </code></li>\n\t<li><code>1 <= <RepeatingPart>.length <= 4 </code></li>\n</ul>\n<span style=\"display:block\"><span style=\"height:0px\"><span style=\"position:absolute\"></span></span></span>",
|
||||
"translatedContent": "<p>给定两个字符串 <code>s</code> 和 <code>t</code> ,每个字符串代表一个非负有理数,只有当它们表示相同的数字时才返回 <code>true</code> 。字符串中可以使用括号来表示有理数的重复部分。</p>\n\n<p><strong>有理数</strong> 最多可以用三个部分来表示:<em>整数部分</em> <code><IntegerPart></code>、<em>小数非重复部分</em> <code><NonRepeatingPart></code> 和<em>小数重复部分</em> <code><(><RepeatingPart><)></code>。数字可以用以下三种方法之一来表示:</p>\n\n<ul>\n\t<li><code><IntegerPart></code> \n\n\t<ul>\n\t\t<li>例: <code>0</code> ,<code>12</code> 和 <code>123</code> </li>\n\t</ul>\n\t</li>\n\t<li><code><IntegerPart><.><NonRepeatingPart></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\"> , </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> , </span></span></font></font><code>2.12</code> 和 <code>123.0001</code></li>\n\t</ul>\n\t</li>\n\t<li><code><IntegerPart><.><NonRepeatingPart><(><RepeatingPart><)></code> \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> </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> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li>每个部分仅由数字组成。</li>\n\t<li>整数部分 <code><IntegerPart></code> 不会以零开头。(零本身除外)</li>\n\t<li><code>1 <= <IntegerPart>.length <= 4 </code></li>\n\t<li><code>0 <= <NonRepeatingPart>.length <= 4 </code></li>\n\t<li><code>1 <= <RepeatingPart>.length <= 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,
|
||||
|
Reference in New Issue
Block a user