      "\n",
      "\n",
      "def bst_successor(node):\n",
      "    if node is None:\n",
      "        return\n",
      "    if node.right is not None:\n",
      "        return left_most_node(node.right)\n",
      "    else:\n",
      "        parent = node.parent\n",
      "        while parent is not None and parent.left is not node:\n",
 
</s> remove     "            return\n",
 </s> add     "            # We reached the root, the original input node\n",
    "            # must be the largest element in the tree.\n",
    "            return None\n", </s> remove     "        return\n",
 </s> add     "        return None\n",
    "        raise Exception('Invalid input node')\n",
      "\n",
      "\n",
      "def bst_successor(node):\n",
      "    if node is None:\n",
    "        raise Exception('Invalid input node')\n",
      "    if node.right is not None:\n",
      "        return left_most_node(node.right)\n",
      "    else:\n",
      "        parent = node.parent\n",
      "        while parent is not None and parent.left is not node:\n",
keep keep keep keep replace keep keep keep keep keep
 Polish bst successor challenge and solution (#82)

Update constraints, test cases, tests, algorithm discussion, and code. 
graphs_trees/bst_successor/bst_successor_solution.ipynb