My C++ solution in 15ms
\tclass Solution {\n\t\tpublic:\n\t\t\tint height(TreeNode root) {\n\t\t\t\tif(root == NULL)return 0;\n\t\t\t\treturn max(height(root->left), height(root->right
\tclass Solution {\n\t\tpublic:\n\t\t\tint height(TreeNode *root) {\n\t\t\t\tif(root == NULL)return 0;\n\t\t\t\treturn max(height(root->left), height(root->right)) + 1;\n\t\t\t}\n\t\t\tbool isBalanced(TreeNode* root) {\n\t\t\t\tif(root == NULL)return true;\n\t\t\t\treturn isBalanced(root->left) && isBalanced(root->right) && abs(height(root->left) - height(root->right)) <= 1;\n\t\t\t}\n\t};
[]