Question
Given a binary tree, determine if it is height-balanced.
For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ by more than 1.
Explanation
在这里还是用递归,判断条件为1. 左右子树均balance 2.左右子树高度只差不超过1. 所以在这道题中,为了能返回两个值,就创建了一个新的类:ResultType。如果用python写就不用了。