https://leetcode.com/problems/daily-temperatures/
class Solution:
def dailyTemperatures(self, temp: List[int]) -> List[int]:
ans = [0] * len(temp)
st = []
for i,e in enumerate(temp):
while len(st)>0 and temp[st[-1]]<e:
item = st.pop()
ans[item] = i-item
st.append(i)
return ans