```
def isBalanced(self, root):
if not root:
return True
else:
return abs(self.maxDepth(root.left) - self.maxDepth(root.right)) <= 1 and self.isBalanced(root.left) and self.isBalanced(root.right)
def maxDepth(self, root):
if not root:
return 0
else:
return max(self.maxDepth(root.left), self.maxDepth(root.left)) + 1
```

OJ says "Time Limit Exceeded". Someone please help! Thanks a lot!