Cody

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

Solution 1378766

Submitted on 13 Dec 2017 by David Verrelli
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
filetext = fileread('your_fcn_name.m'); assert(isempty(strfind(filetext, 'regexp')),'regexp() and its family are forbidden') assert(isempty(strfind(filetext, 'regexprep')),'regexprep() forbidden')

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

u = 2 3 10

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

u = 1 3 7 8

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

u = 5 10 y = logical 1

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

u = 3 4 5 6

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

u = 2 4 y = logical 1

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

u = 1 9

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

u = 7 8 y = logical 1

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

u = 2 3 10 NaN

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

u = ' jk'

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

u = 0 7 8

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

y_correct = logical 0 u = 8 17

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

u = 0 7

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

u = 3 8 y = logical 1

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

u = 0.3000 8.0000

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

u = 1 5 y = logical 1