mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-24 14:28:56 +08:00
移除零宽空格
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
"titleSlug": "solve-the-equation",
|
||||
"content": "<p>Solve a given equation and return the value of <code>'x'</code> in the form of a string <code>"x=#value"</code>. The equation contains only <code>'+'</code>, <code>'-'</code> operation, the variable <code>'x'</code> and its coefficient. You should return <code>"No solution"</code> if there is no solution for the equation, or <code>"Infinite solutions"</code> if there are infinite solutions for the equation.</p>\n\n<p>If there is exactly one solution for the equation, we ensure that the value of <code>'x'</code> is an integer.</p>\n\n<p> </p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> equation = "x+5-3+x=6+x-2"\n<strong>Output:</strong> "x=2"\n</pre>\n\n<p><strong class=\"example\">Example 2:</strong></p>\n\n<pre>\n<strong>Input:</strong> equation = "x=x"\n<strong>Output:</strong> "Infinite solutions"\n</pre>\n\n<p><strong class=\"example\">Example 3:</strong></p>\n\n<pre>\n<strong>Input:</strong> equation = "2x=x"\n<strong>Output:</strong> "x=0"\n</pre>\n\n<p> </p>\n<p><strong>Constraints:</strong></p>\n\n<ul>\n\t<li><code>3 <= equation.length <= 1000</code></li>\n\t<li><code>equation</code> has exactly one <code>'='</code>.</li>\n\t<li><code>equation</code> consists of integers with an absolute value in the range <code>[0, 100]</code> without any leading zeros, and the variable <code>'x'</code>.</li>\n\t<li>The input is generated that if there is a single solution, it will be an integer.</li>\n</ul>\n",
|
||||
"translatedTitle": "求解方程",
|
||||
"translatedContent": "<p>求解一个给定的方程,将<code>x</code>以字符串 <code>\"x=#value\"</code> 的形式返回。该方程仅包含 <code>'+'</code> , <code>'-'</code> 操作,变量 <code>x</code> 和其对应系数。</p>\n\n<p>如果方程没有解或存在的解不为整数,请返回 <code>\"No solution\"</code> 。如果方程有无限解,则返回 <code>“Infinite solutions”</code> 。</p>\n\n<p>题目保证,如果方程中只有一个解,则 <font color=\"#c7254e\"><font face=\"Menlo, Monaco, Consolas, Courier New, monospace\"><span style=\"font-size:12.6px\"><span style=\"background-color:#f9f2f4\">'x'</span></span></font></font> 的值是一个整数。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong> equation = \"x+5-3+x=6+x-2\"\n<strong>输出:</strong> \"x=2\"\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong> equation = \"x=x\"\n<strong>输出:</strong> \"Infinite solutions\"\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong> equation = \"2x=x\"\n<strong>输出:</strong> \"x=0\"\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>3 <= equation.length <= 1000</code></li>\n\t<li><code>equation</code> 只有一个 <code>'='</code>. </li>\n\t<li>方程由绝对值在 <code>[0, 100]</code> 范围内且无任何前导零的整数和变量 <code>'x'</code> 组成。<span style=\"display:block\"><span style=\"height:0px\"><span style=\"position:absolute\"></span></span></span></li>\n</ul>\n",
|
||||
"translatedContent": "<p>求解一个给定的方程,将<code>x</code>以字符串 <code>\"x=#value\"</code> 的形式返回。该方程仅包含 <code>'+'</code> , <code>'-'</code> 操作,变量 <code>x</code> 和其对应系数。</p>\n\n<p>如果方程没有解或存在的解不为整数,请返回 <code>\"No solution\"</code> 。如果方程有无限解,则返回 <code>“Infinite solutions”</code> 。</p>\n\n<p>题目保证,如果方程中只有一个解,则 <font color=\"#c7254e\"><font face=\"Menlo, Monaco, Consolas, Courier New, monospace\"><span style=\"font-size:12.6px\"><span style=\"background-color:#f9f2f4\">'x'</span></span></font></font> 的值是一个整数。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong> equation = \"x+5-3+x=6+x-2\"\n<strong>输出:</strong> \"x=2\"\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong> equation = \"x=x\"\n<strong>输出:</strong> \"Infinite solutions\"\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong> equation = \"2x=x\"\n<strong>输出:</strong> \"x=0\"\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>3 <= equation.length <= 1000</code></li>\n\t<li><code>equation</code> 只有一个 <code>'='</code>. </li>\n\t<li>方程由绝对值在 <code>[0, 100]</code> 范围内且无任何前导零的整数和变量 <code>'x'</code> 组成。<span style=\"display:block\"><span style=\"height:0px\"><span style=\"position:absolute\"></span></span></span></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 217,
|
||||
|
||||
Reference in New Issue
Block a user