Check if a tree is balanced
a post-order variant solution