Hi,

It bares mention that the goal is to get the nth element of the linked list counting in reverse order, and that `n`

is not referring to the list length, but to the position from the end that is our target (this confused me when first reading the algorithm, as I would use `n`

for the entire size personally).

So in a nutshell the condition `if count >= n+1`

really means “have we passed the boundary length of the target?” Because then if so, the remaining `n`

elements from the list are going to shift the pointer to its correct location. The graphic provided in that lesson is very good.

Proof:

Let’s say we have a list size `M`

(ugh, lol), then then `n`

th node from the end is the `M-n+1`

th element. (The trivial case being the first node from the end, the tail, is the M-1+1=`M`

th element). Once we cross over `n`

steps from our first element (n+1), by definition we have `M-n+1`

steps left to move out of bounds. So if we set our goal pointer to start moving from the head there, we will arrive at our `M-n+1`

th position, as desired.

A graphical example:

```
Let M = 8 and n=3
3rd to last item from
1 2 3 4 5 6 7 8
A B C D E F G H
T (T for target)
means we have to reach the (n+1) threshold which is 4.
Once we are here, we have 8-3=5 steps left (to be out),
(when the seeker is on 3, we have M-n+1=8-3+1=6 steps left)
1 2 3 4 5 6 7 8
A B C D E F G H
^
```

```
if we now set a target pointer to head
1 2 3 4 5 6 7 8
A B C D E F G H
^
*
by the time we go out of bounds we will have our desired
target, 6
1 2 3 4 5 6 7 8
A B C D E F G H
^
*
Victory!
```