mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 03:33:12 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			33 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<p>给定一个整数数组 <code>temperatures</code> ,表示每天的温度,返回一个数组 <code>answer</code> ,其中 <code>answer[i]</code> 是指对于第 <code>i</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>
 |