Cody

Solution 1906139

Submitted on 20 Aug 2019 by Tetsuji Tsuda
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
n = 20; m = 5; total = 190; assert(isequal(no_digit_sum(n,m),total))

num = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 p = '5' sum = 0 s = '1' sum = 1 s = '2' sum = 3 s = '3' sum = 6 s = '4' sum = 10 s = '5' s = '6' sum = 16 s = '7' sum = 23 s = '8' sum = 31 s = '9' sum = 40 s = '10' sum = 50 s = '11' sum = 61 s = '12' sum = 73 s = '13' sum = 86 s = '14' sum = 100 s = '15' s = '16' sum = 116 s = '17' sum = 133 s = '18' sum = 151 s = '19' sum = 170 s = '20' sum = 190 total = 190

2   Pass
n = 10; m = 5; total = 50; assert(isequal(no_digit_sum(n,m),total))

num = 1 2 3 4 5 6 7 8 9 10 p = '5' sum = 0 s = '1' sum = 1 s = '2' sum = 3 s = '3' sum = 6 s = '4' sum = 10 s = '5' s = '6' sum = 16 s = '7' sum = 23 s = '8' sum = 31 s = '9' sum = 40 s = '10' sum = 50 total = 50

3   Pass
n = 33; m = 3; total = 396; assert(isequal(no_digit_sum(n,m),total))

num = Columns 1 through 30 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Columns 31 through 33 31 32 33 p = '3' sum = 0 s = '1' sum = 1 s = '2' sum = 3 s = '3' s = '4' sum = 7 s = '5' sum = 12 s = '6' sum = 18 s = '7' sum = 25 s = '8' sum = 33 s = '9' sum = 42 s = '10' sum = 52 s = '11' sum = 63 s = '12' sum = 75 s = '13' s = '14' sum = 89 s = '15' sum = 104 s = '16' sum = 120 s = '17' sum = 137 s = '18' sum = 155 s = '19' sum = 174 s = '20' sum = 194 s = '21' sum = 215 s = '22' sum = 237 s = '23' s = '24' sum = 261 s = '25' sum = 286 s = '26' sum = 312 s = '27' sum = 339 s = '28' sum = 367 s = '29' sum = 396 s = '30' s = '31' s = '32' s = '33' total = 396

Suggested Problems

More from this Author95