Leetcode Balanced Binary Tree Algorithm