     "metadata": {},
     "source": [
      "## Algorithm\n",
      "\n",
      "* Setup two pointers, current and previous\n",
      "* Give current a headstart, incrementing it once if k = 1, twice if k = 2, ...\n",
      "* Increment both pointers until current reaches the end\n",
      "* Return the value of previous\n",
      "\n",
      "Complexity:\n",
      "* Time: O(n)\n",
      "* Space: O(1)"
     ]
 
</s> remove     "        while counter < k:\n",
    "            curr = curr.next\n",
    "            counter += 1\n",
    "            if curr is None:\n",
    "                return\n",
    "\n",
    "        # Increment both pointers until current reaches the end\n",
    "        while curr.next is not None:\n",
    "            curr = curr.next\n",
    "            prev = prev.next\n",
    "        return prev.data"
 </s> add     "        for _ in range(k):\n",
    "            fast = fast.next\n",
    "            # If k >= num elements, return None\n",
    "            if fast is None:\n",
    "                return None\n",
    "\n",
    "        # Increment both pointers until fast reaches the end\n",
    "        while fast.next is not None:\n",
    "            fast = fast.next\n",
    "            slow = slow.next\n",
    "        return slow.data" </s> remove     "            return\n",
    "        if k >= len(self):\n",
    "            return\n",
    "        curr = self.head\n",
    "        prev = self.head\n",
    "        counter = 0\n",
    "\n",
    "        # Give current a headstart, incrementing it\n",
 </s> add     "            return None\n",
    "        fast = self.head\n",
    "        slow = self.head\n",
    "\n",
    "        # Give fast a headstart, incrementing it\n", </s> remove    "display_name": "Python 2",
 </s> add    "display_name": "Python 3", </s> remove    "display_name": "Python 2",
 </s> add    "display_name": "Python 3", </s> remove    "name": "python2"
 </s> add    "name": "python3"
    "* Setup two pointers, fast and slow\n",
    "* Give fast a headstart, incrementing it once if k = 1, twice if k = 2, ...\n",
    "* Increment both pointers until fast reaches the end\n",
    "* Return the value of slow\n",
     "metadata": {},
     "source": [
      "## Algorithm\n",
      "\n",
    "* Setup two pointers, fast and slow\n",
    "* Give fast a headstart, incrementing it once if k = 1, twice if k = 2, ...\n",
    "* Increment both pointers until fast reaches the end\n",
    "* Return the value of slow\n",
    "* Setup two pointers, fast and slow\n",
    "* Give fast a headstart, incrementing it once if k = 1, twice if k = 2, ...\n",
    "* Increment both pointers until fast reaches the end\n",
    "* Return the value of slow\n",
    "* Setup two pointers, fast and slow\n",
    "* Give fast a headstart, incrementing it once if k = 1, twice if k = 2, ...\n",
    "* Increment both pointers until fast reaches the end\n",
    "* Return the value of slow\n",
    "* Setup two pointers, fast and slow\n",
    "* Give fast a headstart, incrementing it once if k = 1, twice if k = 2, ...\n",
    "* Increment both pointers until fast reaches the end\n",
    "* Return the value of slow\n",
      "\n",
      "Complexity:\n",
      "* Time: O(n)\n",
      "* Space: O(1)"
     ]
keep keep keep keep replace replace replace replace keep keep keep keep keep
 Polish kth to last element challenge and solution

Update algorithm discussion and solution. 
linked_lists/kth_to_last_elem/kth_to_last_elem_solution.ipynb