Tap here to switch tabs
Problem
Submissions

Problem: Daily Temperatures

Daily Temperatures gives an array of daily readings and asks for each day’s wait until a warmer day. Return zero when no later reading is warmer.

Statement

Given an array of integers, temperatures, that represents daily temperatures, return an array, output, where each element, output[i], indicates the number of days you need to wait after the ithi^{th} day to experience a warmer temperature if there is no future day with a higher temperature, set output[i] to 0.

Constraints:

  • 1≤1 \leq temperatures.length ≤103 \leq 10^3

  • 30≤30 \leq temperatures[i] ≤100\leq 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Daily Temperatures

Daily Temperatures gives an array of daily readings and asks for each day’s wait until a warmer day. Return zero when no later reading is warmer.

Statement

Given an array of integers, temperatures, that represents daily temperatures, return an array, output, where each element, output[i], indicates the number of days you need to wait after the ithi^{th} day to experience a warmer temperature if there is no future day with a higher temperature, set output[i] to 0.

Constraints:

  • 1≤1 \leq temperatures.length ≤103 \leq 10^3

  • 30≤30 \leq temperatures[i] ≤100\leq 100