Code RoomDaily temperature wait days
MediumPrep Room Coding #157

Daily temperature wait days

CodingAlgorithms & data structuresMid–Senior~25 min

Given a list of daily temperatures (integers), return a list answer where answer[i] is the number of days you must wait after day i to get a warmer temperature. If no future day is warmer, answer[i] is 0. The input has 1 to 10^5 entries and temperatures are between 30 and 100 inclusive.

Implement
daily_temperatures(temps: list[int]) → list[int]
Examples
in[[73,74,75,71,69,72,76,73]]out[1,1,4,2,1,1,0,0]
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

0:00 of about 25 min
InputExpectedGot
[[73,74,75,71,69,72,76,73]][1,1,4,2,1,1,0,0]not run yetsample