append([i, -1]) else: pass if len(todayschange): for i in todayschange: arr[i[0]] += i[1] else: arrayneverchange = 1 return arr 分类: LeetCode 标签: Array 好文要顶 关注我 收藏该文 微信分享 老鼠司令 粉丝- 1 关注- 0 +加关注 0 0 « 上一篇: LeetCode #1176. Diet...
Given an initial arrayarr, every day you produce a new array using the array of the previous day. On thei-th day, you do the following operations on the array of dayi-1to produce the array of dayi: If an element is smaller than both its left neighbor and its right neighbor, then ...