Leetcode 剑指 Offer 11.旋转数组的最小数字参考代码如下:
class Solution:
def minArray(self, numbers: List[int]) -> int:
li=numbers
min=None
for i in range(len(numbers)):
li=li[1:]+[li[0]]
if min==None or li[0]<min:
min=li[0]
return min
题目链接:
https://leetcode.cn/problems/xuan-zhuan-shu-zu-de-zui-xiao-shu-zi-lcof/