Problem can be found in here!
Solution: Monotonic Stack
def dailyTemperatures(temperatures: List[int]) -> List[int]:
n = len(temperatures)
days_to_wait = [0] * n
stack = []
for i in range(n):
while stack and temperatures[stack[-1]] < temperatures[i]:
index = stack.pop()
days_to_wait[index] = i-index
stack.append(i)
return days_to_wait