>_
daily_temperatures.go
Go 1.26
Not run yet

+ 8 hidden

Input
temperatures = [12, 15, 11, 9, 14, 20, 18]
Expected
[1, 4, 2, 1, 1, 0, 0]

After the 15 on day 1, the 11, 9 and 14 are all cooler, so the wait ends at the 20 four days later. Nothing after the 20 or the 18 is warmer, so both get 0.