From 256ca509ab75b5108a3c315ef6449431b0921def Mon Sep 17 00:00:00 2001 From: Zeeland Date: Fri, 6 Jan 2023 17:23:51 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96Python=E8=AF=AD?= =?UTF-8?q?=E6=B3=95=E9=AB=98=E4=BA=AE=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/0042.接雨水.md | 4 ++-- problems/0257.二叉树的所有路径.md | 4 ++-- problems/前序/ACM模式如何构建二叉树.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/problems/0042.接雨水.md b/problems/0042.接雨水.md index e8dd3690..ac6f20f9 100644 --- a/problems/0042.接雨水.md +++ b/problems/0042.接雨水.md @@ -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: # 单调栈 diff --git a/problems/0257.二叉树的所有路径.md b/problems/0257.二叉树的所有路径.md index 2d796671..d0c190a0 100644 --- a/problems/0257.二叉树的所有路径.md +++ b/problems/0257.二叉树的所有路径.md @@ -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 diff --git a/problems/前序/ACM模式如何构建二叉树.md b/problems/前序/ACM模式如何构建二叉树.md index 01d5b255..42bf7af0 100644 --- a/problems/前序/ACM模式如何构建二叉树.md +++ b/problems/前序/ACM模式如何构建二叉树.md @@ -280,7 +280,7 @@ public class Solution { ## Python -```Python3 +```Python class TreeNode: def __init__(self, val = 0, left = None, right = None): self.val = val