JAVA SOLUTION || Beats 95.33%
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\nSimple traversal on each node and check left and right height of current 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\nSimple traversal on each node and check left and right height of current node and if difference of left and right is more than 1 than return false\nelse after traversal of whole tree return true\n\n# Complexity\n- Time complexity:\nO(n)\n\n- Space complexity:\nO(1)\n\n# Code\n```\n/**\n * Definition for a binary tree node.\n * public class TreeNode {\n *     int val;\n *     TreeNode left;\n *     TreeNode right;\n *     TreeNode() {}\n *     TreeNode(int val) { this.val = val; }\n *     TreeNode(int val, TreeNode left, TreeNode right) {\n *         this.val = val;\n *         this.left = left;\n *         this.right = right;\n *     }\n * }\n */\nclass Solution {\n    public boolean isBalanced(TreeNode root) {\n        \n        return maxDepth(root) != -1;\n    }\n\n    int maxDepth(TreeNode root){\n        if(root == null)\n         return 0;\n\n        int lh = maxDepth(root.left);\n        if(lh == -1)\n         return -1;\n\n        int rh = maxDepth(root.right);\n        if(rh == -1)\n         return -1;\n\n        if(Math.abs(lh - rh) > 1)\n         return -1;\n\n        return 1+Math.max(lh, rh);\n    }\n}\n```
['Java']