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

50.0% Correct | 50.0% Incorrect
Last Solution submitted on Apr 21, 2025

Problem Comments

Solution Comments

Show comments

Group

Chess Image
Chess
  • 18 Problems
  • 4 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