class Solution:
def dailyTemperatures(self, temperatures: List[int]) -> List[int]:
ans, stack, n = [0] * len(temperatures), [], len(temperatures)
for i in range(n):
while stack and temperatures[stack[-1]] < temperatures[i]:
pos = stack.pop()
ans[pos] = i - pos
stack.append(i)
return ans
标签:int,每日,pos,LeetCode739,temperatures,ans,stack,温度
From: https://www.cnblogs.com/solvit/p/16732601.html