     },
     "outputs": [],
     "source": [
      "def _check_balance(root):\n",
      "    if not root:\n",
      "        return (True, 0, 0)\n",
      "    left_balanced, left_min_h, left_max_h = _check_balance(root.left)\n",
      "    right_balanced, right_min_h, right_max_h = _check_balance(root.right)\n",
      "    min_h = 1 + min(left_min_h, right_min_h)\n",
      "    max_h = 1 + max(left_max_h, right_max_h)\n",
 
</s> remove     "        return False\n",
 </s> add     "        raise Exception('No root node')\n",
    "    if root is None:\n",
     },
     "outputs": [],
     "source": [
      "def _check_balance(root):\n",
    "    if root is None:\n",
      "        return (True, 0, 0)\n",
      "    left_balanced, left_min_h, left_max_h = _check_balance(root.left)\n",
      "    right_balanced, right_min_h, right_max_h = _check_balance(root.right)\n",
      "    min_h = 1 + min(left_min_h, right_min_h)\n",
      "    max_h = 1 + max(left_max_h, right_max_h)\n",
keep keep keep keep replace keep keep keep keep keep
 Polish bst check balanced challenge and solution (#84)

Update constraints, tests, and code. 
graphs_trees/check_balance/check_balance_solution.ipynb