Quant Memo
Coding/●●●●●

Fewest knight moves across a chessboard

A knight sits on an 8 x 8 board and moves in the usual L-shape (two squares one way, one square perpendicular). Squares are (row, col) with 0 <= row, col < 8.

start = (0, 0), goal = (7, 7)
-> 6           # the corner-to-corner knight distance

Return the minimum number of moves to reach the goal, or -1 if impossible.

Your answer

This one is open-ended. Work it through, then check your reasoning against the full solution.

More Coding questions