Balanced Binary Tree sol2 DFS with helper depth method