mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-10 18:48:13 +08:00
37 lines
1.2 KiB
HTML
37 lines
1.2 KiB
HTML
<p>请根据每日 <code>气温</code> 列表 <code>temperatures</code> ,重新生成一个列表,要求其对应位置的输出为:要想观测到更高的气温,至少需要等待的天数。如果气温在这之后都不会升高,请在该位置用 <code>0</code> 来代替。</p>
|
|
|
|
<p> </p>
|
|
|
|
<p><strong>示例 1:</strong></p>
|
|
|
|
<pre>
|
|
<strong>输入:</strong> <code>temperatures</code> = [73,74,75,71,69,72,76,73]
|
|
<strong>输出:</strong> [1,1,4,2,1,1,0,0]
|
|
</pre>
|
|
|
|
<p><strong>示例 2:</strong></p>
|
|
|
|
<pre>
|
|
<strong>输入:</strong> temperatures = [30,40,50,60]
|
|
<strong>输出:</strong> [1,1,1,0]
|
|
</pre>
|
|
|
|
<p><strong>示例 3:</strong></p>
|
|
|
|
<pre>
|
|
<strong>输入:</strong> temperatures = [30,60,90]
|
|
<strong>输出: </strong>[1,1,0]</pre>
|
|
|
|
<p> </p>
|
|
|
|
<p><strong>提示:</strong></p>
|
|
|
|
<ul>
|
|
<li><code>1 <= temperatures.length <= 10<sup>5</sup></code></li>
|
|
<li><code>30 <= temperatures[i] <= 100</code></li>
|
|
</ul>
|
|
|
|
<p> </p>
|
|
|
|
<p><meta charset="UTF-8" />注意:本题与主站 739 题相同: <a href="https://leetcode-cn.com/problems/daily-temperatures/">https://leetcode-cn.com/problems/daily-temperatures/</a></p>
|