寻找索引最大的山峰,从后往前遍历,遇到山峰就返回。 # 寻找最后的山峰 # @param a int整型一维数组 # @return int整型 # class Solution: def solve(self , a ): # write code here n = len(a) for i in range(n - 1, -1, -1): if (i == n - 1 and a[i] >= a[i - 1]) or (i == 0 and a[i] >= a[i + 1]): ...