Cody

Problem 45433. The Dark Knight

Solution 2874476

Submitted on 24 Aug 2020 by Alfonso Nieto-Castanon
• Size: 77
• This is the leading solution.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
assert(isequal(knight_step([2,2],[3,3],8),2))

2   Pass
assert(isequal(knight_step([2,2],[1,1],20),4))

3   Pass
assert(isequal(knight_step([2,2],[8,8],12),4))

4   Pass
assert(isequal(knight_step([2,2],[12,11],12),7))

5   Pass
assert(isequal(knight_step([1,3],[8,3],8),5))

6   Pass
assert(isequal(knight_step([1,3],[5,4],8),3))

7   Pass
assert(isequal(knight_step([8,2],[1,2],8),5))

8   Pass
assert(isequal(knight_step([8,7],[21,32],50),14))

9   Pass
assert(isequal(knight_step([5,19],[5,19],20),0))

10   Pass
assert(isequal(knight_step([5,19],[19,5],20),10))

Community Treasure Hunt

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

Start Hunting!