Easy solution to understand
\n\n# Code\n\n/**\n * Definition for a binary tree node.\n * struct TreeNode {\n *     int val;\n *     TreeNode *left;\n *     TreeNode *right;\n *     TreeNod
![image.png](https://assets.leetcode.com/users/images/f3984c00-86ff-4038-99c9-42d1ec0bc209_1720156961.6567428.png)\n\n# Code\n```\n/**\n * Definition for a binary tree node.\n * struct TreeNode {\n *     int val;\n *     TreeNode *left;\n *     TreeNode *right;\n *     TreeNode() : val(0), left(nullptr), right(nullptr) {}\n *     TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}\n *     TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}\n * };\n */\nclass Solution {\npublic:\n    bool isBalanced(TreeNode* root) {\n        if(root==NULL)\n            return true;\n        if(abs(maxDepth(root->left)-maxDepth(root->right))>1)\n            return false;\n        if(isBalanced(root->left) && isBalanced(root->right))\n            return true;\n        return false;\n    }\n    int maxDepth(TreeNode* root) {\n        if(root==NULL)\n            return 0;\n        return max(maxDepth(root->left),maxDepth(root->right))+1;\n    }\n};\n```\nIf solutions helps you out in any way then don\'t forget to upvote.\nThank you:)\nAlso, if you still find any difficulty, please comment I\'ll reach out to you.
['C++']