Given daily temperatures, return an array where each position contains the number of days until a warmer temperature.
Use 0 when no warmer future day exists.
Inputtemperatures = [73, 74, 75, 71, 69, 72, 76, 73]
Output[1, 1, 4, 2, 1, 1, 0, 0]
The day at 75 waits 4 days for 76, and the day at 71 waits 2 days for 72. Each other day either has a warmer next day or, for the final two days, no warmer day ahead.
Inputtemperatures = [30, 40, 50, 60]
Output[1, 1, 1, 0]
Each of the first three days is followed immediately by a warmer day. The last day has no future day, so its wait is 0.
1 ≤ temperatures.length ≤ 100,00030 ≤ temperatures[i] ≤ 100