剑指 Offer 11. 旋转数组的最小数字
def minArray(self, numbers: List[int]) -> int: num1 = numbers[0] num2 = numbers[0] for i in range(len(numbers)-1): if numbers[i] > numbers[i+1]: num2 = numbers[i+1] break return min(num1,num2)
leetCode 783 二叉搜索树节点最小距离
def minDiffInBST(root:list): root.sort(reverse=True) min = 9999999 for i in range(len(root)-1): if root[i]-root[i+1] < min: min = root[i]-root[i+1] return min