class Solution:
def dailyTemperatures(self, T: List[int]) -> List[int]:
l=len(T)
stack=[]
ans=[0]*l
for i in range(l):
while stack and T[i]>T[stack[-1]]:
idx=stack.pop()
ans[idx]=i-idx
stack.append(i)
return ans