Cody

# Problem 44441. Jack's hand in "Titanic" ♤

Solution 1981250

Submitted on 18 Oct 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
filetext = fileread('your_fcn_name.m'); assert(isempty(strfind(filetext, 'regexp')),'regexp() and its family are forbidden') assert(isempty(strfind(filetext, 'regexprep')),'regexprep() forbidden')

Error in solution: Line: 8 Column: 2 Illegal use of reserved keyword "else".

2   Fail
x = [10 3 10 2 3]; y_correct = false; assert(isequal(your_fcn_name(x),y_correct))

Error in solution: Line: 8 Column: 2 Illegal use of reserved keyword "else".

3   Fail
x = [1 8 1 7 3]; y_correct = false; assert(isequal(your_fcn_name(x),y_correct))

Error in solution: Line: 8 Column: 2 Illegal use of reserved keyword "else".

4   Fail
x = [10 5 10 5 10]; y_correct = true; assert(isequal(your_fcn_name(x),y_correct))

Error in solution: Line: 8 Column: 2 Illegal use of reserved keyword "else".

5   Fail
x = [4 4 6 3 5]; y_correct = false; assert(isequal(your_fcn_name(x),y_correct))

Error in solution: Line: 8 Column: 2 Illegal use of reserved keyword "else".

6   Fail
x = [2 4 2 4 4]; y_correct = true; assert(isequal(your_fcn_name(x),y_correct))

Error in solution: Line: 8 Column: 2 Illegal use of reserved keyword "else".

7   Fail
x = [1 9 9 9 9]; y_correct = false; assert(isequal(your_fcn_name(x),y_correct))

Error in solution: Line: 8 Column: 2 Illegal use of reserved keyword "else".

8   Fail
x = [8 7 8 7 8]; y_correct = true; assert(isequal(your_fcn_name(x),y_correct))

Error in solution: Line: 8 Column: 2 Illegal use of reserved keyword "else".

9   Fail
x = [nan 3 10 2 3]; y_correct = false; assert(isequal(your_fcn_name(x),y_correct))

Error in solution: Line: 8 Column: 2 Illegal use of reserved keyword "else".

10   Fail
x = [10 'k' 'j' 2 3]; y_correct = false; assert(isequal(your_fcn_name(x),y_correct))

Error in solution: Line: 8 Column: 2 Illegal use of reserved keyword "else".

11   Fail
x = [8 7 8 0 8]; y_correct = false; %inexistant card assert(isequal(your_fcn_name(x),y_correct))

Error in solution: Line: 8 Column: 2 Illegal use of reserved keyword "else".

12   Fail
x = [8 17 8 17 8] ; y_correct = false %inexistant card assert(isequal(your_fcn_name(x),y_correct))

Error in solution: Line: 8 Column: 2 Illegal use of reserved keyword "else".

13   Fail
x = [0 7 0 7 0]; y_correct = false; %inexistant card assert(isequal(your_fcn_name(x),y_correct))

Error in solution: Line: 8 Column: 2 Illegal use of reserved keyword "else".

14   Fail
x = [8 3 3 8 3]; y_correct = true; assert(isequal(your_fcn_name(x),y_correct))

Error in solution: Line: 8 Column: 2 Illegal use of reserved keyword "else".

15   Fail
x = [8 .3 .3 8 .3]; y_correct = false; %invalid card assert(isequal(your_fcn_name(x),y_correct))

Error in solution: Line: 8 Column: 2 Illegal use of reserved keyword "else".

16   Fail
x = [1 1 1 5 5]; y_correct = true; assert(isequal(your_fcn_name(x),y_correct))

Error in solution: Line: 8 Column: 2 Illegal use of reserved keyword "else".