Simple java clean solution!
/**\n     * Definition for a binary tree node.\n     * public class TreeNode {\n     *     int val;\n     *     TreeNode left;\n     *     TreeNode right;\n    
    /**\n     * Definition for a binary tree node.\n     * public class TreeNode {\n     *     int val;\n     *     TreeNode left;\n     *     TreeNode right;\n     *     TreeNode(int x) { val = x; }\n     * }\n     */\n    public class Solution {\n        public boolean isBalanced(TreeNode root) {\n            if (root == null){\n                return true;\n            }\n            int leftHeight = getHeight (root.left);\n            int rightHeight = getHeight (root.right);\n            if (Math.abs (leftHeight - rightHeight) > 1){\n                return false;\n            }\n            return (isBalanced (root.left) && isBalanced (root.right));\n        }\n        \n        public int getHeight (TreeNode root){\n            if (root == null){\n                return 0;\n            }\n            else {\n                return Math.max (getHeight(root.left), getHeight(root.right)) + 1;\n            }\n        }\n    }
[]