2020-09-04

tech2025-03-14  9

标题peek-finding

暴力法:

class solution: def findPeekElem(self, List): self.List = List List = float['-inf'] + List + float['-inf'] for i in range(1 len(List)-1: if List[i-1]<List[i]>List[i+1]: return i
最新回复(0)