Google | Knight's Shortest Path on an Infinite Chessboard
Anonymous User
28961

https://leetcode.com/problems/minimum-knight-moves/

Given an infinite chessboard, find minimum no. of steps for a knight to reach from the origin to (x, y).

Accepted solution: Bidirectional BFS.
There's also constant time solution.

Follow-up:
A list of forbidden coordinates are introduced where knight can’t reach. Handle this in your code. Make sure the infinite loop is handled since the board is infinite.

Related problems:

Comments (11)