Minimum Knight Moves on a Chessboard

Minimum Knight Moves on a Chessboard

Given an n × n chessboard, a knight start position (sr, sc), and a target (tr, tc), return the minimum number of knight moves required to reach the targe...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: