Cody

Solution 1797689

Submitted on 26 Apr 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('howManyWays.m'); assert(isempty(strfind(filetext, 'assert'))) assert(isempty(strfind(filetext, 'echo')))

2   Fail
x = [1 1 1 1]; y_correct = 1; assert(isequal(howManyWays(x),y_correct))

Error using nchoosek (line 65) K must be an integer between 0 and N. Error in howManyWays (line 14) p=unique(nchoosek(west2,2),'rows'); Error in Test2 (line 3) assert(isequal(howManyWays(x),y_correct))

3   Fail
x = [1 1 1 10]; y_correct = 3; %[14,32,50] assert(isequal(howManyWays(x),y_correct))

Error using nchoosek (line 65) K must be an integer between 0 and N. Error in howManyWays (line 14) p=unique(nchoosek(west2,2),'rows'); Error in Test3 (line 3) assert(isequal(howManyWays(x),y_correct))

4   Fail
x = [12 24 24 30]; y_correct = 5; %[102,114,126,138,150] assert(isequal(howManyWays(x),y_correct))

u = 90 102 114 126 138 150 y = 6

Assertion failed.

5   Fail
x = [22 34 34 43]; y_correct = 6; %[155 167 179 185 197 215] assert(isequal(howManyWays(x),y_correct))

u = 143 155 167 173 179 185 197 215 y = 8

Assertion failed.

6   Fail
x = [6 6 10 12]; y_correct = 7; %[36 40 44 48 52 56 60] assert(isequal(howManyWays(x),y_correct))

u = 36 40 44 48 52 56 y = 6

Assertion failed.

7   Fail
x = [6 6 7 8]; y_correct = 8; %[32 33 34 35 36 37 38 40] assert(isequal(howManyWays(x),y_correct))

u = 32 33 34 35 36 37 38 y = 7

Assertion failed.

8   Fail
x = [3 4 9 9]; y_correct = 9; assert(isequal(howManyWays(x),y_correct))

u = 22 23 24 25 33 34 35 45 y = 8

Assertion failed.

9   Fail
x = [4 6 8 11]; y_correct = 10; assert(isequal(howManyWays(x),y_correct))

u = 33 35 37 39 41 43 45 49 y = 8

Assertion failed.

10   Fail
x = [1 5 6 7]; y_correct = 13; assert(isequal(howManyWays(x),y_correct))

u = 20 23 24 25 26 27 28 29 30 31 33 y = 11

Assertion failed.

11   Fail
x = [1 2 5 8]; y_correct = 14; assert(isequal(howManyWays(x),y_correct))

u = 15 17 18 19 21 22 24 25 27 28 30 34 y = 12

Assertion failed.

12   Fail
x = [1 2 5 10]; y_correct = 15; assert(isequal(howManyWays(x),y_correct))

u = 17 19 20 21 23 24 26 27 30 33 34 36 40 y = 13

Assertion failed.

13   Fail
x = [1 2 5 11]; y_correct = 15; assert(isequal(howManyWays(x),y_correct))

u = 18 20 21 22 24 25 27 28 31 36 37 39 43 y = 13

Assertion failed.

14   Fail
x = [2 5 9 11]; y_correct = 12; assert(isequal(howManyWays(x),y_correct))

u = 28 29 32 35 36 39 40 43 44 47 51 y = 11

Assertion failed.

15   Fail
x = [3 8 13 16]; y_correct = 11; assert(isequal(howManyWays(x),y_correct))

u = 43 48 53 58 59 63 64 68 74 y = 9

Assertion failed.

16   Fail
x = [7 13 15 16]; y_correct = 11; assert(isequal(howManyWays(x),y_correct))

u = 58 62 64 66 68 70 72 74 76 78 y = 10

Assertion failed.

17   Fail
x = [3 34 43 47]; y_correct = 15; assert(isequal(howManyWays(x),y_correct))

u = 130 152 161 170 178 179 187 192 201 209 210 219 227 y = 13

Assertion failed.

18   Fail
x = [21 35 38 39]; y_correct = 15; assert(isequal(howManyWays(x),y_correct))

u = 154 165 168 171 173 174 176 182 185 187 188 191 193 y = 13

Assertion failed.

19   Fail
x = [5 10 34 36]; y_correct = 15; assert(isequal(howManyWays(x),y_correct))

u = 71 90 95 100 119 123 124 128 143 147 148 172 176 y = 13

Assertion failed.

20   Fail
x = [ 55 97 154 193]; y_correct = 15; assert(isequal(howManyWays(x),y_correct))

u = 539 554 596 638 653 695 710 731 752 773 788 809 887 y = 13

Assertion failed.

21   Fail
x = [107 116 165 170]; y_correct = 15; assert(isequal(howManyWays(x),y_correct))

u = 625 665 674 683 723 732 733 742 772 781 782 830 840 y = 13

Assertion failed.

22   Fail
x = [329 592 611 641]; y_correct = 15; assert(isequal(howManyWays(x),y_correct))

u = 2502 2746 2765 2784 2803 2844 2863 3028 3047 3066 3085 3107 3145 y = 13

Assertion failed.

23   Fail
x = [3259 4164 5259 6544]; y_correct = 15; assert(isequal(howManyWays(x),y_correct))

u = 22295 22485 23390 24295 24485 25390 25580 26485 27055 27580 27960 28150 30150 y = 13

Assertion failed.

24   Fail
x = [5947 6267 8477 9254]; y_correct = 15; assert(isequal(howManyWays(x),y_correct))

u = 34002 35892 36212 36532 38422 38742 39976 40296 40632 40952 42186 43162 44716 y = 13

Assertion failed.

25   Fail
x = [726 871 871 964]; y_correct = 6; %[4158 4303 4448 4489 4634 4820] assert(isequal(howManyWays(x),y_correct))

u = 4013 4158 4303 4344 4448 4489 4634 4820 y = 8

Assertion failed.