Better Solve
/* Initial configuration. */
int move = 0; // moves so far.
int r = lo; // current row of Kn.
int c = lo; // current column of Kn.
/* Let <r,c> be coordinates of an unvisited "neighbor" of current <r,c>, or <UNDEFINED,UNDEFINED> if current square has no unvisited neighbors. */