mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-21 21:16:45 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个已按照<strong><em> </em>升序排列 </strong>的整数数组 <code>numbers</code> ,请你从数组中找出两个数满足相加之和等于目标数 <code>target</code> 。</p>\n\n<p>函数应该以长度为 <code>2</code> 的整数数组的形式返回这两个数的下标值<em>。</em><code>numbers</code> 的下标 <strong>从 0 开始计数</strong> ,所以答案数组应当满足 <code>0 <= answer[0] < answer[1] < numbers.length</code> 。</p>\n\n<p>假设数组中存在且只存在一对符合条件的数字,同时一个数字不能使用两次。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>numbers = [1,2,4,6,10], target = 8\n<strong>输出:</strong>[1,3]\n<strong>解释:</strong>2 与 6 之和等于目标数 8 。因此 index1 = 1, index2 = 3 。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>numbers = [2,3,4], target = 6\n<strong>输出:</strong>[0,2]\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>numbers = [-1,0], target = -1\n<strong>输出:</strong>[0,1]\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>2 <= numbers.length <= 3 * 10<sup>4</sup></code></li>\n\t<li><code>-1000 <= numbers[i] <= 1000</code></li>\n\t<li><code>numbers</code> 按 <strong>递增顺序</strong> 排列</li>\n\t<li><code>-1000 <= target <= 1000</code></li>\n\t<li>仅存在一个有效答案</li>\n</ul>\n\n<p> </p>\n\n<p>注意:本题与主站 167 题相似(下标起点不同):<a href=\"https://leetcode-cn.com/problems/two-sum-ii-input-array-is-sorted/\">https://leetcode-cn.com/problems/two-sum-ii-input-array-is-sorted/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 25,
|
||||
"likes": 32,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -156,7 +156,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"24.3K\", \"totalSubmission\": \"37.8K\", \"totalAcceptedRaw\": 24339, \"totalSubmissionRaw\": 37849, \"acRate\": \"64.3%\"}",
|
||||
"stats": "{\"totalAccepted\": \"27.9K\", \"totalSubmission\": \"43.5K\", \"totalAcceptedRaw\": 27919, \"totalSubmissionRaw\": 43454, \"acRate\": \"64.2%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
|
Reference in New Issue
Block a user