Skip to content

Commit

Permalink
Merge pull request youngyangyang04#961 from Martin-Hsu/patch-3
Browse files Browse the repository at this point in the history
Update 0739.每日温度.md
  • Loading branch information
youngyangyang04 authored Dec 28, 2021
2 parents 3f378c5 + 2a59d4f commit 0e95220
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions problems/0739.每日温度.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ public:
vector<int> dailyTemperatures(vector<int>& T) {
stack<int> st; // 递减栈
vector<int> result(T.size(), 0);
st.push(0);
for (int i = 1; i < T.size(); i++) {
for (int i = 0; i < T.size(); i++) {
while (!st.empty() && T[i] > T[st.top()]) { // 注意栈不能为空
result[st.top()] = i - st.top();
st.pop();
Expand Down

0 comments on commit 0e95220

Please sign in to comment.