      "\n",
      "However, we could check whether the tree is balanced while also checking for the heights.\n",
      "\n",
      "* Base case: If the root is None, return 0\n",
      "* Check the height of `root.left`, if -1, return -1\n",
      "* Check the height of `root.right`, if -1, return -1\n",
      "* If the height differences is greater than 1, return -1\n",
      "* Otherwise, return 1 + max(left height, right height)\n",
      "    \n",
      "Complexity:\n",
      "* Time: O(n)\n",
      "* Space: O(h), where h is the height of the tree"
     ]
 
</s> remove     "    if check_height(root) == -1:\n",
    "        return False\n",
    "    else:\n",
    "        return True\n",
    "\n",
    "def check_height(root):\n",
    "    if root is None:\n",
    "        return 0\n",
    "    left_height = check_height(root.left)\n",
    "    if left_height == -1:\n",
    "        return -1\n",
    "    right_height = check_height(root.right)\n",
    "    if right_height == -1:\n",
    "        return -1\n",
    "    diff_height = left_height - right_height\n",
    "    if abs(diff_height) > 1:\n",
    "        return -1\n",
    "    else:\n",
    "        return 1 + max(left_height, right_height)"
 </s> add     "    balanced, _, _ = __check_balance__(root)\n",
    "    return balanced"
    "* Recursively check whether the left sub tree is balanced, and get its maximum and minimum height\n",
    "* Recursively Check whether the right sub tree is balanced, and get its maximum and minimum height\n",
    "* Calculate the maximum height and minimum height of the current tree\n",
    "* If both sub-trees are balanced, and the maximum and minimum height of the current tree doesn't differ by more than 1, then the current tree is balanced. Otherwise, it is not\n",
    "* Return whether the current tree is balanced, and the maximum height and minimum height of the current tree\n",
      "\n",
      "However, we could check whether the tree is balanced while also checking for the heights.\n",
      "\n",
      "* Base case: If the root is None, return 0\n",
    "* Recursively check whether the left sub tree is balanced, and get its maximum and minimum height\n",
    "* Recursively Check whether the right sub tree is balanced, and get its maximum and minimum height\n",
    "* Calculate the maximum height and minimum height of the current tree\n",
    "* If both sub-trees are balanced, and the maximum and minimum height of the current tree doesn't differ by more than 1, then the current tree is balanced. Otherwise, it is not\n",
    "* Return whether the current tree is balanced, and the maximum height and minimum height of the current tree\n",
    "* Recursively check whether the left sub tree is balanced, and get its maximum and minimum height\n",
    "* Recursively Check whether the right sub tree is balanced, and get its maximum and minimum height\n",
    "* Calculate the maximum height and minimum height of the current tree\n",
    "* If both sub-trees are balanced, and the maximum and minimum height of the current tree doesn't differ by more than 1, then the current tree is balanced. Otherwise, it is not\n",
    "* Return whether the current tree is balanced, and the maximum height and minimum height of the current tree\n",
    "* Recursively check whether the left sub tree is balanced, and get its maximum and minimum height\n",
    "* Recursively Check whether the right sub tree is balanced, and get its maximum and minimum height\n",
    "* Calculate the maximum height and minimum height of the current tree\n",
    "* If both sub-trees are balanced, and the maximum and minimum height of the current tree doesn't differ by more than 1, then the current tree is balanced. Otherwise, it is not\n",
    "* Return whether the current tree is balanced, and the maximum height and minimum height of the current tree\n",
    "* Recursively check whether the left sub tree is balanced, and get its maximum and minimum height\n",
    "* Recursively Check whether the right sub tree is balanced, and get its maximum and minimum height\n",
    "* Calculate the maximum height and minimum height of the current tree\n",
    "* If both sub-trees are balanced, and the maximum and minimum height of the current tree doesn't differ by more than 1, then the current tree is balanced. Otherwise, it is not\n",
    "* Return whether the current tree is balanced, and the maximum height and minimum height of the current tree\n",
      "    \n",
      "Complexity:\n",
      "* Time: O(n)\n",
      "* Space: O(h), where h is the height of the tree"
     ]
keep keep keep keep replace replace replace replace keep keep keep keep keep
 Fix check_balance solution for a new test case 
graphs_trees/check_balance/check_balance_solution.ipynb