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,7 +12,7 @@
"translatedContent": "<p>给你一个下标从 0 开始的整数数组 <code>nums</code> ,返回 <code>nums</code> 中满足<em> </em><code>i mod 10 == nums[i]</code><em> </em>的最小下标 <code>i</code> ;如果不存在这样的下标,返回<em> </em><code>-1</code><em> </em>。</p>\n\n<p><code>x mod y</code> 表示 <code>x</code> 除以 <code>y</code> 的 <strong>余数</strong> 。</p>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1</strong></p>\n\n<pre><strong>输入:</strong>nums = [0,1,2]\n<strong>输出:</strong>0\n<strong>解释:</strong>\ni=0: 0 mod 10 = 0 == nums[0].\ni=1: 1 mod 10 = 1 == nums[1].\ni=2: 2 mod 10 = 2 == nums[2].\n所有下标都满足 i mod 10 == nums[i] ,所以返回最小下标 0\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre><strong>输入:</strong>nums = [4,3,2,1]\n<strong>输出:</strong>2\n<strong>解释:</strong>\ni=0: 0 mod 10 = 0 != nums[0].\ni=1: 1 mod 10 = 1 != nums[1].\ni=2: 2 mod 10 = 2 == nums[2].\ni=3: 3 mod 10 = 3 != nums[3].\n2 唯一一个满足 i mod 10 == nums[i] 的下标\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre><strong>输入:</strong>nums = [1,2,3,4,5,6,7,8,9,0]\n<strong>输出:</strong>-1\n<strong>解释:</strong>不存在满足 i mod 10 == nums[i] 的下标\n</pre>\n\n<p><strong>示例 4</strong></p>\n\n<pre><strong>输入:</strong>nums = [2,1,3,5,2]\n<strong>输出:</strong>1\n<strong>解释:</strong>1 是唯一一个满足 i mod 10 == nums[i] 的下标\n</pre>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 &lt;= nums.length &lt;= 100</code></li>\n\t<li><code>0 &lt;= nums[i] &lt;= 9</code></li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 5,
"likes": 6,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -137,7 +137,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"7.7K\", \"totalSubmission\": \"10K\", \"totalAcceptedRaw\": 7727, \"totalSubmissionRaw\": 10040, \"acRate\": \"77.0%\"}",
"stats": "{\"totalAccepted\": \"8.2K\", \"totalSubmission\": \"10.6K\", \"totalAcceptedRaw\": 8189, \"totalSubmissionRaw\": 10641, \"acRate\": \"77.0%\"}",
"hints": [
"Starting with i=0, check the condition for each index. The first one you find to be true is the smallest index."
],