문제는 쉬운편이다. Stack의 기본 문제인 탑 문제와 같은 문제이다.
백준 탑문제

import java.util.*;
class Solution {
public int[] dailyTemperatures(int[] temperatures) {
final Stack<int[]> stack = new Stack<>();
int[] result = new int[temperatures.length];
int idx = 0;
for(int temp : temperatures){
while(!stack.isEmpty()){
if (stack.peek()[1]>=temp){
break;
}
int[] next = stack.pop();
result[next[0]] = idx - next[0];
}
stack.add(new int[]{idx,temp});
idx ++;
}
return result;
}
}