diff --git a/problems/0739.每日温度.md b/problems/0739.每日温度.md index d16416d9..d025e73c 100644 --- a/problems/0739.每日温度.md +++ b/problems/0739.每日温度.md @@ -152,8 +152,7 @@ public: vector dailyTemperatures(vector& T) { stack st; // 递减栈 vector 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();