Is height balanced?

question–>
https://practice.geeksforgeeks.org/problems/check-for-balanced-tree/1
code–>


not passing all test cases

Hey @sheikhhaji18
If left and right tree second is false then we will return false
So check that before your if conditions
Also in base case make pmsecond =truee because empty node is always balanced

thanks passed testcases

1 Like