Definition at line 5 of file main.cpp.
◆ dailyTemperatures()
| vector< int > Solution::dailyTemperatures |
( |
vector< int > & |
temperatures | ) |
|
|
inline |
Definition at line 8 of file main.cpp.
9 {
10 stack<int> temp_ind;
11 int size = (int)temperatures.size();
12 vector<int> days(size, 0);
13 for (int i = 0; i < size; ++i)
14 {
15 while (!temp_ind.empty() && temperatures[i] > temperatures[temp_ind.top()])
16 {
17 days[temp_ind.top()] = i - temp_ind.top();
18 temp_ind.pop();
19 }
20 temp_ind.push(i);
21 }
22 return days;
23 }
The documentation for this class was generated from the following file: