|
|
|
|
|
by salvipeter
1247 days ago
|
|
If you drop the sequential restriction, this becomes a pretty neat shortest path problem, essentially the same as LeetCode 847, but the simple dynamic programming approach does not work here (too much memory needed). It can be transformed to TSP, though, which gives an optimal solution (using Concorde) of just 46 moves:
http://directory.iit.bme.hu/~salvi/archive/snippets/knight/k... |
|