Link: https://leetcode.com/problems/daily-temperatures/
Solution:
Topics: monotonic stack
Intuition
Easy problem. Simple monotonic decreasing stack. Keep a tuple (temp, index)
on the stack. While the current temperature exceeds the top of the stack, pop off and update the result of the popped index to current_index-popped_index
. Too easy honestly.
Implementation