Dodomeki
Sign in

16. Days Until Warmer

Easy

A weather station recorded the temperature for each day in temperaturas. For each position, return how many days you have to wait until a warmer temperature appears. If it never happens, use 0.

Example 1
Input: temperaturas = [19, 22, 21, 25]
Output: [1, 2, 1, 0]
Explanation: After 19 there is 22 the next day; after 22 there is 25 two days later.
Example 2
Input: temperaturas = [30, 28, 28]
Output: [0, 0, 0]
Constraints
  • 0 <= temperaturas.length <= 10^5
  • -50 <= temperaturas[i] <= 60
ArraysStack
Caso 1
temperaturas =
[19,22,21,25]
Expected =
[1,2,1,0]
Caso 2
temperaturas =
[30,28,28]
Expected =
[0,0,0]

Run checks these 2 cases. Submit runs all 6, including hidden ones.