未验证 提交 86fc4b42 编写于 作者: K Keqi Huang 提交者: GitHub

Merge pull request #263 from Qipccc/patch-1

Update 06-旋转数组的最小数字.py
......@@ -13,14 +13,14 @@ class Solution:
else:
while (rear - front) > 1:
mid = (front + rear) // 2
if rotateArray[mid] >= rotateArray[front]:
front = mid
elif rotateArray[mid] <= rotateArray[rear]:
rear = mid
elif rotateArray[front] == rotateArray[rear] == rotateArray[mid]:
if rotateArray[front] == rotateArray[rear] == rotateArray[mid]:
for i in range(1, len(rotateArray)):
if rotateArray[i] < minVal:
minVal = rotateArray[i]
rear = i
elif rotateArray[mid] >= rotateArray[front]:
front = mid
elif rotateArray[mid] <= rotateArray[rear]:
rear = mid
minVal = rotateArray[rear]
return minVal
\ No newline at end of file
return minVal
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册