
At a weather feature for ClimaNow, you are given a list of daily temperatures. For each day, return how many days you must wait until a warmer temperature occurs. If no future day is warmer, return 0 for that position.
temperatures, where temperatures[i] is the temperature on day ianswer of the same length, where answer[i] is the number of days until a warmer temperature after day i, or 0 if none existsExample 1
temperatures = [73, 74, 75, 71, 69, 72, 76, 73][1, 1, 4, 2, 1, 1, 0, 0]75), the next warmer day is day 6 (76), so the wait is 4 days.Example 2
temperatures = [30, 40, 50, 60][1, 1, 1, 0]Example 3
temperatures = [60, 50, 40][0, 0, 0]1 <= len(temperatures) <= 10^530 <= temperatures[i] <= 100temperatures = [73, 74, 75, 71, 69, 72, 76, 73]Output[1, 1, 4, 2, 1, 1, 0, 0]WhyEach value shows the distance to the next future day with a strictly higher temperature.temperatures = [30, 40, 50, 60]Output[1, 1, 1, 0]WhyEvery day except the last is followed immediately by a warmer day.temperatures = [60, 50, 40]Output[0, 0, 0]WhyThe temperatures keep decreasing, so no warmer future day exists for any index.1 <= len(temperatures) <= 10^530 <= temperatures[i] <= 100The output array must have the same length as the inputA warmer day means a strictly greater temperaturedef daily_temperatures(temperatures):