单调栈
class Solution:
def dailyTemperatures(self, temperatures):
size = len(temperatures)
ll = []
ans = [0] * size
for i in range(size - 1, -1, -1):
while ll and temperatures[i] >= temperatures[ll[-1]]:
ll.pop()
if ll:
ans[i] = ll[-1] - i
ll.append(i)
return ans