There is no one universal definition for balanced binary trees. In my answer above, I pointed out that AVL tree uses the same height-balanced definition as in this problem.

Well no.
Have you tried? Puting the abs forward results 20ms, 16ms, and the original version results in 15ms, 16ms.
It's seems because the test cases are too weak...

After isBalancedTreeHelper(root->right,right) call gets complete, wouldn't values of left and right variables be same? Because left and right are alias to depth variable.

Hi,
could you tell me why top - down solution is o(n^2) time complexity ?
my understanding is worst case would be linked list
then f(n) = o(n) + f(n-1) = o(n^2).
Please confirm
thanks.

cgl1027. for this task yes. but there is another definition "every leaf should be away from root with difference no more than 1" which fails the testcase.