King's Cage - MATLAB Cody - MATLAB Central

Problem 45427. King's Cage

Difficulty:Rate

Given the position of the king on the chessboard, determine the minimum number of steps it'll require to reach the destination.

https://en.wikipedia.org/wiki/Chess#Movement

For simplicity, numerical notation is used to represent the positions.

Solution Stats

53.13% Correct | 46.88% Incorrect
Last Solution submitted on Feb 11, 2025

Problem Comments

Solution Comments

Show comments

Group

Number theory Image
Number theory
  • 44 Problems
  • 21 Finishers

Problem Recent Solvers43

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Go to top of page