← All problems
Daily Temperatures
For each day, how many days until a warmer temperature (0 if none).
Complexity
Time O(n), Space O(n)
Common pitfalls
- O(n^2) rescanning
- Using temperatures instead of indices (need distances)
Your solution
Log in to save your code and track progress.