Coding Trainer

Daily Temperatures

MediumMonotonic StackLC #739

Problem

Given daily temperatures, return array where answer[i] is the number of days to wait for a warmer temperature. 0 if no warmer day exists.

Example: [73,74,75,71,69,72,76,73] → [1,1,4,2,1,1,0,0]