标签:off class pre ota 一个 div array solution temp
旋转后的数组先递增,然后突然断层,让后又递增,所以,只要找到数组突然变小的那个数字即可。
# -*- coding:utf-8 -*- class Solution: def minNumberInRotateArray(self, rotateArray): if rotateArray is None: return None temp = rotateArray[0] for i in range(len(rotateArray) - 1): if rotateArray[i] > rotateArray[i+1]: temp = rotateArray[i+1] break return temp
标签:off class pre ota 一个 div array solution temp
原文地址:https://www.cnblogs.com/wangzhihang/p/11781065.html