mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-10 20:40:39 +08:00
Update 0654.最大二叉树.md
This commit is contained in:
@ -292,6 +292,8 @@ class Solution:
|
||||
|
||||
```
|
||||
(版本二) 使用下标
|
||||
```python
|
||||
|
||||
class Solution:
|
||||
def traversal(self, nums: List[int], left: int, right: int) -> TreeNode:
|
||||
if left >= right:
|
||||
@ -309,7 +311,8 @@ class Solution:
|
||||
return self.traversal(nums, 0, len(nums))
|
||||
|
||||
|
||||
```
|
||||
```python
|
||||
|
||||
(版本三) 使用切片
|
||||
class Solution:
|
||||
def constructMaximumBinaryTree(self, nums: List[int]) -> TreeNode:
|
||||
|
Reference in New Issue
Block a user