# 110. Balanced Binary Tree

`check(node):  if root     return true  left_height = height_find(node.left)+1  right_height =height_find(node.right)+1  if abs(left_height -right_height) >1     return false  left = check(node.left)  right = check(node.right)    if left ==false  or right == false    return false  return true`
`class Solution:    def isBalanced(self, root: Optional[TreeNode]) -> bool:        if self.rec(root) ==-1:            return False        return True        def rec(self,root):        if not root:            return 0        left = self.rec(root.left)        right=self.rec(root.right)                if left==-1 or right == -1 or abs(right-left)>1 :            return -1        return 1 + max(left,right)`

--

--

--

## More from Dhanarajappu

Tech-Enthusiast, Coder,Explorer,Geeky,Software Engineer |A piece of code delivers everything that you need. The world is all about codes.

Love podcasts or audiobooks? Learn on the go with our new app.

## Dhanarajappu

Tech-Enthusiast, Coder,Explorer,Geeky,Software Engineer |A piece of code delivers everything that you need. The world is all about codes.