← ALL NOTES
Array

739. Daily Temperatures

For each day, how many days until a warmer one? This is the archetypal next-greater-element problem, and the tool is a monotonic decreasing stack of indices: days waiting for a warmer future sit on…

Loading…