Skip to content

Commit efd6f22

Browse files
authored
feat: $739 python3 code
1 parent 8492b02 commit efd6f22

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

daily/2019-06-06.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,21 @@ var dailyTemperatures = function(T) {
8080
};
8181
```
8282

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+
8398
## 优秀解答
8499

85100
> 暂缺

0 commit comments

Comments
 (0)