Update construct_tree_inorder_preorder.py

This commit is contained in:
bt3gl 2023-07-30 15:51:57 -07:00 committed by GitHub
parent 38cbe1c55b
commit e7d855b99e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,3 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# author: bt3gl
def build_tree(preorder: list[int], inorder: list[int]) -> Optional[TreeNode]:
def helper(i_left, i_right, index_map):