Cody

# Problem 1189. Knights and Knaves (part 3)

Solution 1938726

Submitted on 17 Sep 2019
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

letters = 65 lett = 1×1 cell array {'A'}

Unable to perform assignment because the indices on the left side are not compatible with the size of the right side. Error in solver (line 20) password(i) = letters(logical(ss)); Error in Test1 (line 7) assert(isequal(solver(F),'PASSWORD'))

2   Fail

letters = 65 lett = 1×1 cell array {'A'} lett = 1×1 cell array {'A'} lett = 1×1 cell array {'A'} lett = 1×1 cell array {'A'} lett = 1×1 cell array {'A'} lett = 1×1 cell array {'A'} lett = 1×1 cell array {'A'} lett = 1×1 cell array {'A'} lett = 1×1 cell array {'A'}

Index exceeds the number of array elements (8). Error in Test2>@(str)xor(~KNIGHT,g(eval(str),KNIGHT,PASSWORD)) (line 4) F=@(str)xor(~KNIGHT,g(eval(str),KNIGHT,PASSWORD)); Error in solver (line 16) ss(k)=Q(['PASSWORD(' num2str(i) ')==96' ]); Error in Test2 (line 7) assert(isequal(solver(F),'PASSWORD'))

3   Fail

letters = 65 lett = 1×1 cell array {'A'} lett = 1×1 cell array {'A'} lett = 1×1 cell array {'A'} lett = 1×1 cell array {'A'} lett = 1×1 cell array {'A'} lett = 1×1 cell array {'A'} lett = 1×1 cell array {'A'} lett = 1×1 cell array {'A'} lett = 1×1 cell array {'A'}

Assertion failed.

4   Fail

letters = 65 lett = 1×1 cell array {'A'}

Unable to perform assignment because the indices on the left side are not compatible with the size of the right side. Error in solver (line 20) password(i) = letters(logical(ss)); Error in Test4 (line 7) assert(isequal(solver(F),'FORTYTWO'))

5   Fail