Cody

Solution 1797779

Submitted on 26 Apr 2019 by Paul Smits
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   Pass
x = [1 1 1 1]; y_correct = 1; assert(isequal(howManyWays(x),y_correct))

u = 5 y = 1

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

u = 14 32 50 y = 3

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

u = 102 114 126 138 150 y = 5

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

u = 155 167 179 185 197 215 y = 6

6   Pass
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 60 y = 7

7   Pass
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 40 y = 8

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

u = 24 28 29 30 34 35 39 40 45 y = 9

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

u = 33 35 37 39 41 43 45 47 49 55 y = 10

10   Pass
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 32 33 35 y = 13

11   Pass
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 31 34 40 y = 14

12   Pass
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 37 40 50 y = 15

13   Pass
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 40 43 55 y = 15

14   Pass
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 55 y = 12

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

u = 43 48 53 58 59 63 64 68 69 74 80 y = 11

16   Pass
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 80 y = 11

17   Pass
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 218 219 227 235 y = 15

18   Pass
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 190 191 193 195 y = 15

19   Pass
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 152 172 176 180 y = 15

20   Pass
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 830 887 965 y = 15

21   Pass
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 791 830 840 850 y = 15

22   Pass
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 3126 3145 3205 y = 15

23   Pass
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 29055 30150 32720 y = 15

24   Pass
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 42506 43162 44716 46270 y = 15

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

u = 4158 4303 4448 4489 4634 4820 y = 6