Cody

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

Solution 1981247

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   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   Fail
x = [10 3 10 2 3]; y_correct = false; assert(isequal(your_fcn_name(x),y_correct))

a = 1 2 2 b = 2 3 10

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". Error in Test2 (line 3) assert(isequal(your_fcn_name(x),y_correct))

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

a = 2 1 1 1 b = 1 3 7 8

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". Error in Test3 (line 3) assert(isequal(your_fcn_name(x),y_correct))

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

a = 2 3 b = 5 10

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". Error in Test4 (line 3) assert(isequal(your_fcn_name(x),y_correct))

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

a = 1 2 1 1 b = 3 4 5 6

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". Error in Test5 (line 3) assert(isequal(your_fcn_name(x),y_correct))

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

a = 2 3 b = 2 4

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". Error in Test6 (line 3) assert(isequal(your_fcn_name(x),y_correct))

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

a = 1 4 b = 1 9

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". Error in Test7 (line 3) assert(isequal(your_fcn_name(x),y_correct))

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

a = 2 3 b = 7 8

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". Error in Test8 (line 3) assert(isequal(your_fcn_name(x),y_correct))

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

Error using histc Edge vector must be monotonically non-decreasing. Error in hist (line 152) nn = histc(y,edgesc,1); Error in your_fcn_name (line 2) [a b]=hist(x,unique(x)) Error in Test9 (line 3) assert(isequal(your_fcn_name(x),y_correct))

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

Error using hist (line 79) Input arguments must be numeric or a categorical array. Error in your_fcn_name (line 2) [a b]=hist(x,unique(x)) Error in Test10 (line 3) assert(isequal(your_fcn_name(x),y_correct))

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

a = 1 1 3 b = 0 7 8

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". Error in Test11 (line 3) assert(isequal(your_fcn_name(x),y_correct))

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

y_correct = logical 0 a = 3 2 b = 8 17

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". Error in Test12 (line 3) assert(isequal(your_fcn_name(x),y_correct))

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

a = 3 2 b = 0 7

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". Error in Test13 (line 3) assert(isequal(your_fcn_name(x),y_correct))

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

a = 3 2 b = 3 8

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". Error in Test14 (line 3) assert(isequal(your_fcn_name(x),y_correct))

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

a = 3 2 b = 0.3000 8.0000

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". Error in Test15 (line 3) assert(isequal(your_fcn_name(x),y_correct))

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

a = 3 2 b = 1 5

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". Error in Test16 (line 3) assert(isequal(your_fcn_name(x),y_correct))