GamifiedGamified challengesPracticeRaceLeaderboardPricing

Learn data structures by watching them move, then doing it yourself. Press M anytime to toggle sound.

A product of Amypo Technologies, Coimbatore.

Learn

  • All topics
  • Learning path
  • How it works
  • About dotprep

Practice

  • Practice arena
  • Daily challenge
  • Gamified challenges
  • Race mode
  • Leaderboard

Interview prep

  • Java interview
  • Coding questions
  • Company questions
  • System design
  • Jobs & careers

You

  • Dashboard
  • Settings
  • Pricing
  • Create account

© 2026 dotprep

Content last updated 20 November 2026

GamifiedGamified challengesPracticeRaceLeaderboardPricing
Log inStart free
Gamified challengesWarmer Day Forecast

Gamified challenge · Monotonic stack

Warmer Day Forecast

temps[i] is the temperature on day i. For every day, find how many days you have to wait for a strictly warmer day. If no warmer day ever comes, the answer for that day is 0.

Write daysToWarmer(temps) (Python: days_to_warmer(temps)) that returns a list of the same length, in day order.

Example: [73, 74, 75, 71, 69, 72, 76, 73] gives [1, 1, 4, 2, 1, 1, 0, 0]. Day 2 (75°) waits 4 days for 76°; an equal temperature doesn't count as warmer.

Sign in to play Warmer Day Forecast

This game is part of the paid plans. Sign in, then pick a plan to write your answer, watch it play out, and step through the algorithm with its guide.

Sign in with Google

or log in with email · create an account