arrow_back Back to Challenges

#739 Daily Temperatures

Medium Acceptance 0%
description

Problem Description

Given an array of integers `temperatures` represents the daily temperatures, return an array `answer` such that `answer[i]` is the number of days you have to wait after the `i`th day to get a warmer temperature. If there is no future day with warmer temperature, keep `answer[i] == 0`.

checklist Constraints

1 <= temperatures.length <= 10^5
30 <= temperatures[i] <= 100

science Examples

Case #1

In: temperatures = [73,74,75,71,69,72,76,73]
Out: [1,1,4,2,1,1,0,0]

Case #2

In: temperatures = [30,40,50,60]
Out: [1,1,1,0]

Mastery Tags

Arrays Stack

Hiring Companies

Amazon Bloomberg Google
code

Integrated IDE

code_blocks
Coding
psychology
Aptitude