zhongju

Description

Given a list of daily temperatures T, return a list such that, for each day in the input, tells you how many days you would have to wait until a warmer temperature. If there is no future day for which this is possible, put 0 instead.
给定一个每日温度列表 T,返回一个列表,对于每一天的温度,能告诉你到下一个更温暖的温度还需等多少天。如果等不到这一天,则返回 0

For example, given the list of temperatures T = [73, 74, 75, 71, 69, 72, 76, 73], your output should be [1, 1, 4, 2, 1, 1, 0, 0].
例如,给定输入 T = [73, 74, 75, 71, 69, 72, 76, 73],你的输出应该是 [1, 1, 4, 2, 1, 1, 0, 0]

Note

The length of temperatures will be in the range [1, 30000]. Each temperature will be an integer in the range [30, 100].
temperature 的长度在 [1, 300000]。每一天的温度的范围在 [30, 100]。(译者注:这一定不是在地球上的温度,或者用的是华氏温标?

分类:

技术点:

相关文章: