mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-02 22:13:28 +08:00
update
This commit is contained in:
@@ -12,13 +12,19 @@
|
||||
"translatedContent": "<p>给你一个整数数组 <code>queries</code> 和一个 <strong>正</strong> 整数 <code>intLength</code> ,请你返回一个数组 <code>answer</code> ,其中 <code>answer[i]</code> 是长度为 <code>intLength</code> 的 <strong>正回文数</strong> 中第<em> </em><code>queries[i]</code> 小的数字,如果不存在这样的回文数,则为 <code>-1</code> 。</p>\n\n<p><strong>回文数</strong> 指的是从前往后和从后往前读一模一样的数字。回文数不能有前导 0 。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<b>输入:</b>queries = [1,2,3,4,5,90], intLength = 3\n<b>输出:</b>[101,111,121,131,141,999]\n<strong>解释:</strong>\n长度为 3 的最小回文数依次是:\n101, 111, 121, 131, 141, 151, 161, 171, 181, 191, 202, ...\n第 90 个长度为 3 的回文数是 999 。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<b>输入:</b>queries = [2,4,6], intLength = 4\n<b>输出:</b>[1111,1331,1551]\n<strong>解释:</strong>\n长度为 4 的前 6 个回文数是:\n1001, 1111, 1221, 1331, 1441 和 1551 。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= queries.length <= 5 * 10<sup>4</sup></code></li>\n\t<li><code>1 <= queries[i] <= 10<sup>9</sup></code></li>\n\t<li><code>1 <= intLength <= 15</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 17,
|
||||
"likes": 21,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
"contributors": [],
|
||||
"langToValidPlayground": "{\"cpp\": false, \"java\": false, \"python\": false, \"python3\": false, \"mysql\": false, \"mssql\": false, \"oraclesql\": false, \"c\": false, \"csharp\": false, \"javascript\": false, \"ruby\": false, \"bash\": false, \"swift\": false, \"golang\": false, \"scala\": false, \"html\": false, \"pythonml\": false, \"kotlin\": false, \"rust\": false, \"php\": false, \"typescript\": false, \"racket\": false, \"erlang\": false, \"elixir\": false}",
|
||||
"topicTags": [
|
||||
{
|
||||
"name": "Array",
|
||||
"slug": "array",
|
||||
"translatedName": "数组",
|
||||
"__typename": "TopicTagNode"
|
||||
},
|
||||
{
|
||||
"name": "Math",
|
||||
"slug": "math",
|
||||
@@ -137,7 +143,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"5K\", \"totalSubmission\": \"16.4K\", \"totalAcceptedRaw\": 5011, \"totalSubmissionRaw\": 16412, \"acRate\": \"30.5%\"}",
|
||||
"stats": "{\"totalAccepted\": \"5.9K\", \"totalSubmission\": \"18.5K\", \"totalAcceptedRaw\": 5922, \"totalSubmissionRaw\": 18524, \"acRate\": \"32.0%\"}",
|
||||
"hints": [
|
||||
"For any value of queries[i] and intLength, how can you check if there exists at least queries[i] palindromes of length intLength?",
|
||||
"Since a palindrome reads the same forwards and backwards, consider how you can efficiently find the first half (ceil(intLength/2) digits) of the palindrome."
|
||||
|
Reference in New Issue
Block a user