1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-02 22:13:28 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-05-02 23:44:12 +08:00
parent 7ea03594b3
commit 2a71c78585
4790 changed files with 11696 additions and 10944 deletions

View File

@@ -12,13 +12,19 @@
"translatedContent": "<p>给你一个整数数组&nbsp;<code>queries</code>&nbsp;和一个 <strong>正</strong>&nbsp;整数&nbsp;<code>intLength</code>&nbsp;,请你返回一个数组&nbsp;<code>answer</code>&nbsp;,其中&nbsp;<code>answer[i]</code> 是长度为&nbsp;<code>intLength</code>&nbsp;的&nbsp;<strong>正回文数</strong> 中第<em>&nbsp;</em><code>queries[i]</code>&nbsp;小的数字,如果不存在这样的回文数,则为 <code>-1</code>&nbsp;。</p>\n\n<p><strong>回文数</strong> 指的是从前往后和从后往前读一模一样的数字。回文数不能有前导 0 。</p>\n\n<p>&nbsp;</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>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 &lt;= queries.length &lt;= 5 * 10<sup>4</sup></code></li>\n\t<li><code>1 &lt;= queries[i] &lt;= 10<sup>9</sup></code></li>\n\t<li><code>1 &lt;= intLength&nbsp;&lt;= 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."