      "        while parent is not None and parent.left is not node:\n",
      "            node = node.parent\n",
      "            parent = node.parent\n",
      "        if parent is None:\n",
      "            return\n",
      "        return parent.data"
     ]
    },
    {
     "cell_type": "markdown",
 
</s> remove     "        return\n",
 </s> add     "        raise Exception('Invalid input node')\n", </s> remove     "        return\n",
 </s> add     "        return None\n", </s> remove     "* Time: O(n)\n",
    "* Space: O(h), where h is the height of the tree"
 </s> add     "* Time: O(h), where h is the height of the tree\n",
    "* Space: O(h), where h is the recursion depth (tree height), or O(1) if using an iterative approach"
    "            # We reached the root, the original input node\n",
    "            # must be the largest element in the tree.\n",
    "            return None\n",
      "        while parent is not None and parent.left is not node:\n",
      "            node = node.parent\n",
      "            parent = node.parent\n",
      "        if parent is None:\n",
    "            # We reached the root, the original input node\n",
    "            # must be the largest element in the tree.\n",
    "            return None\n",
      "        return parent.data"
     ]
    },
    {
     "cell_type": "markdown",
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