Daily Temperatures
Difficulty: Medium · Pattern: Monotonic Stack · Concept: General Coding (DSA) — Core Patterns to Drill
Largest Rectangle in a Skyline used a monotonic stack to compute an area. This problem applies the same stack discipline to a completely different question, the "next greater element" pattern: given a list of daily temperatures, for each day return how many days until a strictly warmer day, or 0 if none exists.
Your task: implement days_until_warmer(temps) in time. Return a list the same length as temps.
Next: Design an LRU Cache