      "        assert_equal(check_balance(node), False)\n",
      "\n",
      "        print('Success: test_check_balance')\n",
      "\n",
      "\n",
      "def main():\n",
      "    test = TestCheckBalance()\n",
 
</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" </s> remove     "* 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",
 </s> add     "* 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",
    "        node = Node(3)\n",
    "        insert(node, 2)\n",
    "        insert(node, 1)\n",
    "        insert(node, 5)\n",
    "        insert(node, 4)\n",
    "        insert(node, 6)\n",
    "        insert(node, 7)\n",
    "        assert_equal(check_balance(node), False)\n",
    "\n",
      "        assert_equal(check_balance(node), False)\n",
      "\n",
    "        node = Node(3)\n",
    "        insert(node, 2)\n",
    "        insert(node, 1)\n",
    "        insert(node, 5)\n",
    "        insert(node, 4)\n",
    "        insert(node, 6)\n",
    "        insert(node, 7)\n",
    "        assert_equal(check_balance(node), False)\n",
    "\n",
      "        print('Success: test_check_balance')\n",
      "\n",
      "\n",
      "def main():\n",
      "    test = TestCheckBalance()\n",
keep add keep keep keep keep keep
 Fix check_balance solution for a new test case 
graphs_trees/check_balance/check_balance_solution.ipynb