1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-13 01:15:14 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2025-09-29 14:43:44 +08:00
parent 2862a227c4
commit 13f2098086
4409 changed files with 168933 additions and 166256 deletions

View File

@@ -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>