Cody

# Problem 45427. King's Cage

Solution 2199401

Submitted on 8 Apr 2020
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   Fail
x=[1,1]; y=[5,5]; assert(isequal( king(x,y),4))

Error in solution: Line: 9 Column: 90 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

2   Fail
x=[6,6]; y=[2,3]; assert(isequal( king(x,y),4))

Error in solution: Line: 9 Column: 90 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

3   Fail
x=[5,1]; y=[5,5]; assert(isequal( king(x,y),4))

Error in solution: Line: 9 Column: 90 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

4   Fail
x=[2,3]; y=[8,8]; assert(isequal( king(x,y),6))

Error in solution: Line: 9 Column: 90 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

5   Fail
x=[2,8]; y=[7,1]; assert(isequal( king(x,y),7))

Error in solution: Line: 9 Column: 90 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

6   Fail
x=[1,4]; y=[8,3]; assert(isequal( king(x,y),7))

Error in solution: Line: 9 Column: 90 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

7   Fail
x=[5,8]; y=[5,8]; assert(isequal( king(x,y),0))

Error in solution: Line: 9 Column: 90 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

8   Fail
x=[1,4]; y=[3,4]; assert(isequal( king(x,y),2))

Error in solution: Line: 9 Column: 90 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

### Community Treasure Hunt

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

Start Hunting!