mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-22 13:36:46 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>整数数组 <code>nums</code> 按升序排列,数组中的值 <strong>互不相同</strong> 。</p>\n\n<p>在传递给函数之前,<code>nums</code> 在预先未知的某个下标 <code>k</code>(<code>0 <= k < nums.length</code>)上进行了 <strong>旋转</strong>,使数组变为 <code>[nums[k], nums[k+1], ..., nums[n-1], nums[0], nums[1], ..., nums[k-1]]</code>(下标 <strong>从 0 开始</strong> 计数)。例如, <code>[0,1,2,4,5,6,7]</code> 在下标 <code>3</code> 处经旋转后可能变为 <code>[4,5,6,7,0,1,2]</code> 。</p>\n\n<p>给你 <strong>旋转后</strong> 的数组 <code>nums</code> 和一个整数 <code>target</code> ,如果 <code>nums</code> 中存在这个目标值 <code>target</code> ,则返回它的下标,否则返回 <code>-1</code> 。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [<code>4,5,6,7,0,1,2]</code>, target = 0\n<strong>输出:</strong>4\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [<code>4,5,6,7,0,1,2]</code>, target = 3\n<strong>输出:</strong>-1</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [1], target = 0\n<strong>输出:</strong>-1\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= nums.length <= 5000</code></li>\n\t<li><code>-10^4 <= nums[i] <= 10^4</code></li>\n\t<li><code>nums</code> 中的每个值都 <strong>独一无二</strong></li>\n\t<li>题目数据保证 <code>nums</code> 在预先未知的某个下标上进行了旋转</li>\n\t<li><code>-10^4 <= target <= 10^4</code></li>\n</ul>\n\n<p> </p>\n\n<p><strong>进阶:</strong>你可以设计一个时间复杂度为 <code>O(log n)</code> 的解决方案吗?</p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 1941,
|
||||
"likes": 1949,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Search in Rotated Sorted Array II\", \"titleSlug\": \"search-in-rotated-sorted-array-ii\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u641c\\u7d22\\u65cb\\u8f6c\\u6392\\u5e8f\\u6570\\u7ec4 II\"}, {\"title\": \"Find Minimum in Rotated Sorted Array\", \"titleSlug\": \"find-minimum-in-rotated-sorted-array\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u5bfb\\u627e\\u65cb\\u8f6c\\u6392\\u5e8f\\u6570\\u7ec4\\u4e2d\\u7684\\u6700\\u5c0f\\u503c\"}]",
|
||||
@@ -143,7 +143,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"486.7K\", \"totalSubmission\": \"1.1M\", \"totalAcceptedRaw\": 486743, \"totalSubmissionRaw\": 1123760, \"acRate\": \"43.3%\"}",
|
||||
"stats": "{\"totalAccepted\": \"488.7K\", \"totalSubmission\": \"1.1M\", \"totalAcceptedRaw\": 488671, \"totalSubmissionRaw\": 1127987, \"acRate\": \"43.3%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
|
Reference in New Issue
Block a user