mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-08 08:50:15 +08:00
Update 0739.每日温度.md
This commit is contained in:
@ -192,7 +192,7 @@ class Solution {
|
||||
否则的话,可以直接入栈。
|
||||
注意,单调栈里 加入的元素是 下标。
|
||||
*/
|
||||
Stack<Integer>stack=new Stack<>();
|
||||
Deque<Integer> stack=new LinkedList<>();
|
||||
stack.push(0);
|
||||
for(int i=1;i<lens;i++){
|
||||
|
||||
@ -216,7 +216,7 @@ class Solution {
|
||||
public int[] dailyTemperatures(int[] temperatures) {
|
||||
int lens=temperatures.length;
|
||||
int []res=new int[lens];
|
||||
Stack<Integer>stack=new Stack<>();
|
||||
Deque<Integer> stack=new LinkedList<>();
|
||||
for(int i=0;i<lens;i++){
|
||||
|
||||
while(!stack.isEmpty()&&temperatures[i]>temperatures[stack.peek()]){
|
||||
|
Reference in New Issue
Block a user