Solve KBalancedBinaryTree.