Solution to Balanced Binary Tree