mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 07:21:40 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一个仅由数字 6 和 9 组成的正整数 <code>num</code>。</p>\n\n<p>你最多只能翻转一位数字,将 6 变成 9,或者把 9 变成 6 。</p>\n\n<p>请返回你可以得到的最大数字。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre><strong>输入:</strong>num = 9669\n<strong>输出:</strong>9969\n<strong>解释:</strong>\n改变第一位数字可以得到 6669 。\n改变第二位数字可以得到 9969 。\n改变第三位数字可以得到 9699 。\n改变第四位数字可以得到 9666 。\n其中最大的数字是 9969 。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre><strong>输入:</strong>num = 9996\n<strong>输出:</strong>9999\n<strong>解释:</strong>将最后一位从 6 变到 9,其结果 9999 是最大的数。</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre><strong>输入:</strong>num = 9999\n<strong>输出:</strong>9999\n<strong>解释:</strong>无需改变就已经是最大的数字了。</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= num <= 10^4</code></li>\n\t<li><code>num</code> 每一位上的数字都是 6 或者 9 。</li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 57,
|
||||
"likes": 59,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -143,7 +143,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"27.7K\", \"totalSubmission\": \"36.9K\", \"totalAcceptedRaw\": 27733, \"totalSubmissionRaw\": 36868, \"acRate\": \"75.2%\"}",
|
||||
"stats": "{\"totalAccepted\": \"28.4K\", \"totalSubmission\": \"37.8K\", \"totalAcceptedRaw\": 28449, \"totalSubmissionRaw\": 37787, \"acRate\": \"75.3%\"}",
|
||||
"hints": [
|
||||
"Convert the number in an array of its digits.",
|
||||
"Brute force on every digit to get the maximum number."
|
||||
|
Reference in New Issue
Block a user