Opens in a new window
Daniel Larlham Jr.
,详情可参考safew官方下载
Beyond the obvious engineering effort that has gone into creating one of the slimmest phones ever made, the Air is a reductive exercise that boils down the iPhone into the absolute essentials in a premium body.,这一点在WPS官方版本下载中也有详细论述
思路:① 找初始左边界:第一个 nums[i] nums[i+1];② 找初始右边界:最后一个 nums[i] < nums[i-1];③ 求 [left,right] 内 min、max;④ 向左扩展:nums[left-1] minVal 则 left--;⑤ 向右扩展:nums[right+1] < maxVal 则 right++。长度 = right - left + 1。