mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-07 15:45:40 +08:00
update 优化Python语法高亮显示
This commit is contained in:
@ -471,7 +471,7 @@ class Solution {
|
||||
### Python:
|
||||
|
||||
双指针法
|
||||
```python3
|
||||
```Python
|
||||
class Solution:
|
||||
def trap(self, height: List[int]) -> int:
|
||||
res = 0
|
||||
@ -510,7 +510,7 @@ class Solution:
|
||||
return result
|
||||
```
|
||||
单调栈
|
||||
```python3
|
||||
```Python
|
||||
class Solution:
|
||||
def trap(self, height: List[int]) -> int:
|
||||
# 单调栈
|
||||
|
@ -468,7 +468,7 @@ class Solution {
|
||||
---
|
||||
## Python:
|
||||
递归法+隐形回溯
|
||||
```Python3
|
||||
```Python
|
||||
# Definition for a binary tree node.
|
||||
# class TreeNode:
|
||||
# def __init__(self, val=0, left=None, right=None):
|
||||
@ -499,7 +499,7 @@ class Solution:
|
||||
|
||||
迭代法:
|
||||
|
||||
```python3
|
||||
```Python
|
||||
from collections import deque
|
||||
|
||||
|
||||
|
@ -280,7 +280,7 @@ public class Solution {
|
||||
|
||||
## Python
|
||||
|
||||
```Python3
|
||||
```Python
|
||||
class TreeNode:
|
||||
def __init__(self, val = 0, left = None, right = None):
|
||||
self.val = val
|
||||
|
Reference in New Issue
Block a user