Added solution2 for balanced binary tree