We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8492b02 commit efd6f22Copy full SHA for efd6f22
daily/2019-06-06.md
@@ -80,6 +80,21 @@ var dailyTemperatures = function(T) {
80
};
81
```
82
83
+Python3 代码:
84
+
85
+```python
86
+class Solution:
87
+ def dailyTemperatures(self, T: List[int]) -> List[int]:
88
+ stack = []
89
+ ans = [0] * len(T)
90
+ for i in range(len(T)):
91
+ while stack and T[i] > T[stack[-1]]:
92
+ peek = stack.pop(-1)
93
+ ans[peek] = i - peek
94
+ stack.append(i)
95
+ return ans
96
+```
97
98
## 优秀解答
99
100
> 暂缺
0 commit comments