The current position of the knight is x The desired destination is y The size of the chessboard is n.
Find the minimum number of moves required by the knight to reach the destination.
For example,
x=[2,2] y=[3,3] -- moves required = 2 [2,2] > [1,4] > [3,3]
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers26
Suggested Problems
-
Remove all the words that end with "ain"
2737 Solvers
-
Return a list sorted by number of occurrences
2902 Solvers
-
Create a matrix X, where each column is a shifted copy of the vector v
228 Solvers
-
Sum the elements in either diagonal of a square matrix
223 Solvers
-
Number of Even Elements in Fibonacci Sequence
1697 Solvers
More from this Author174
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!