Find a continuous path filling whole 3xN grid going through certain points in given order
Hint: if this is a homework problem that comes up in a chapter on graphs, you might want to consider forming a graph.

A common pattern in applications of graphs is to let each node in the graph represent the "state" of the world at some point in time, and then use that graph somehow.

Suppose you're following some continuous path through this grid, and at some point in time in the middle of your traversal, I yell "freeze!", temporarily pause time, and look at the state of the world at that point in time (ignoring past or future).  What information do I need to record, to fully describe the state of the world (where you are) at that point in time?  How many different possible states are there?  Now create a graph where ..., and.....  (you fill in the rest)