Solution for Balanced Binary Tree