Daily Temperatures

Given an array of integers representing daily temperatures, return an array such that each element at index i gives the number of days you have to wait after that day to encounter a warmer temperature. If no future days are warmer, the output should be 0 for that day.

Constraints

  • 1 <= temperatures.length <= 100000
  • 30 <= temperatures[i] <= 100
Saving… · 2 lines
class Solution:
def dailyTemperatures(self, temperatures: List[int]) -> List[int]:
Console

Click Run to execute sample tests.