mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-13 01:15:14 +08:00
update
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
<p>搜索旋转数组。给定一个排序后的数组,包含n个整数,但这个数组已被旋转过很多次了,次数不详。请编写代码找出数组中的某个元素,假设数组元素原先是按升序排列的。若有多个相同元素,返回索引值最小的一个。</p>
|
||||
|
||||
<p><strong>示例1:</strong></p>
|
||||
<p><strong>示例 1:</strong></p>
|
||||
|
||||
<pre><strong> 输入</strong>: arr = [15, 16, 19, 20, 25, 1, 3, 4, 5, 7, 10, 14], target = 5
|
||||
<strong> 输出</strong>: 8(元素5在该数组中的索引)
|
||||
<pre>
|
||||
<strong> 输入:</strong>arr = [15, 16, 19, 20, 25, 1, 3, 4, 5, 7, 10, 14], target = 5
|
||||
<strong> 输出:</strong>8(元素5在该数组中的索引)
|
||||
</pre>
|
||||
|
||||
<p><strong>示例2:</strong></p>
|
||||
<p><strong>示例 2:</strong></p>
|
||||
|
||||
<pre><strong> 输入</strong>:arr = [15, 16, 19, 20, 25, 1, 3, 4, 5, 7, 10, 14], target = 11
|
||||
<pre>
|
||||
<strong> 输入</strong>:arr = [15, 16, 19, 20, 25, 1, 3, 4, 5, 7, 10, 14], target = 11
|
||||
<strong> 输出</strong>:-1 (没有找到)
|
||||
</pre>
|
||||
|
||||
|
Reference in New Issue
Block a user