@@ -0,0 +1,1498 @@
+# Definition for a binary tree node.%0A# class TreeNode:%0A#     def __init__(self, x):%0A#         self.val = x%0A#         self.left = None%0A#         self.right = None%0A%0Aimport math%0A%0A%0Aclass TreeNode:%0A%0A    def __init__(self, val, left=None, right=None):%0A        self.val = val%0A        self.left = left%0A        self.right = right%0A%0A%0Aclass Solution:%0A%0A    @staticmethod%0A    def createTree(ary) -%3E TreeNode:%0A%0A        treenode = %5B%5D%0A        for elem in ary:%0A            treenode.append(TreeNode(elem))%0A%0A        aryLen = len(ary)%0A        hierarchy = aryLen / 2 - 1%0A%0A        for index in range(math.ceil(hierarchy)):%0A            treenode%5Bindex%5D.left = treenode%5Bindex * 2 + 1%5D%0A            treenode%5Bindex%5D.right = treenode%5Bindex * 2 + 2%5D%0A%0A        hierarchy = math.floor(hierarchy)%0A        treenode%5Bhierarchy%5D.left = treenode%5Bhierarchy * 2 + 1%5D%0A        if aryLen %25 2 == 1:%0A            treenode%5Bhierarchy%5D.right = treenode%5Bhierarchy * 2 + 2%5D%0A%0A        return treenode%5B0%5D%0A%0A    def mergeTrees(self, t1: TreeNode, t2: TreeNode) -%3E TreeNode:%0A%0A        if t1 is not None and t2 is not None:%0A%0A            node = TreeNode(t1.val + t2.val)%0A            node.left = self.mergeTrees(t1.left, t2.left)%0A            node.right = self.mergeTrees(t1.right, t2.right)%0A%0A            return node%0A        elif t1 is None:%0A            return t2%0A        elif t2 is None:%0A            return t1%0A%0A%0Aary1 = %5B1, 3, 2, 5%5D%0Aary2 = %5B2, 1, 3, 8, 4, 6, 7%5D%0A%0Asol = Solution()%0At1 = sol.createTree(ary1)%0At2 = sol.createTree(ary2)%0Aprint(sol.mergeTrees(t1, t2))%0A

add `merge two binary trees` python solution