Python 反转字符串
# # 寻找最后的山峰 # @param a int整型一维数组 # @return int整型 # class Solution: def solve(self , a ): # write code here if len(a)==1: return 0 na=a[::-1] for i in range(0,len(na)): if na[-1]<na[i] and na[i]>na[i+1]: return len(a)-i-1
Python 反转字符串
# # 寻找最后的山峰 # @param a int整型一维数组 # @return int整型 # class Solution: def solve(self , a ): # write code here if len(a)==1: return 0 na=a[::-1] for i in range(0,len(na)): if na[-1]<na[i] and na[i]>na[i+1]: return len(a)-i-1