107: Daily temperatures

Given a list of daily temperatures, return an array that tells you how many days you need to wait until a warmer temperature

Note: put 0 if there is no warmer day

 

Example 1

Input:   [32, 30, 35, 34]

Output:  [2, 1, 0, 0]

Example 2

Input:   [30, 30, 32, 34]

Output:  [2, 1, 1, 0]
Difficulty:Medium
Topic:Stack
Problem #:107