经典单调栈问题
class Solution {
public:vector<int> dailyTemperatures(vector<int>& temperatures) {stack<int> stk;vector<int> result(temperatures.size());for(int i=0;i<temperatures.size();i++){while(!stk.empty()&&temperatures[i]>temperatures[stk.top()]){result[stk.top()] = i - stk.top();stk.pop();}stk.push(i);}return result;}
};