Knight Minimum Moves

Prereq: BFS on Graph

On an infinitely large chessboard, a knight is located on [0, 0].

A knight can move in eight directions.

Given a destination coordinate [x, y], determine the minimum number of moves from [0, 0] to [x, y].

Invest in Yourself
Your new job is waiting. 83% of people that complete the program get a job offer. Unlock unlimited access to all content and features.
Go Pro