Cody

Solution 1945026

Submitted on 21 Sep 2019 at 14:41 by Doan Quang Manh
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))

a = '1' b = 1 a = '2' b = 1 2 a = '3' b = 1 2 3 a = '4' b = 1 2 3 4 a = '5' a = '6' b = 1 2 3 4 6 a = '7' b = 1 2 3 4 6 7 a = '8' b = 1 2 3 4 6 7 8 a = '9' b = 1 2 3 4 6 7 8 9 a = '10' b = 1 2 3 4 6 7 8 9 10 a = '11' b = 1 2 3 4 6 7 8 9 10 11 a = '12' b = 1 2 3 4 6 7 8 9 10 11 12 a = '13' b = 1 2 3 4 6 7 8 9 10 11 12 13 a = '14' b = 1 2 3 4 6 7 8 9 10 11 12 13 14 a = '15' a = '16' b = 1 2 3 4 6 7 8 9 10 11 12 13 14 16 a = '17' b = 1 2 3 4 6 7 8 9 10 11 12 13 14 16 17 a = '18' b = 1 2 3 4 6 7 8 9 10 11 12 13 14 16 17 18 a = '19' b = 1 2 3 4 6 7 8 9 10 11 12 13 14 16 17 18 19 a = '20' b = 1 2 3 4 6 7 8 9 10 11 12 13 14 16 17 18 19 20 total = 190

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

a = '1' b = 1 a = '2' b = 1 2 a = '3' b = 1 2 3 a = '4' b = 1 2 3 4 a = '5' a = '6' b = 1 2 3 4 6 a = '7' b = 1 2 3 4 6 7 a = '8' b = 1 2 3 4 6 7 8 a = '9' b = 1 2 3 4 6 7 8 9 a = '10' b = 1 2 3 4 6 7 8 9 10 total = 50

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

a = '1' b = 1 a = '2' b = 1 2 a = '3' a = '4' b = 1 2 4 a = '5' b = 1 2 4 5 a = '6' b = 1 2 4 5 6 a = '7' b = 1 2 4 5 6 7 a = '8' b = 1 2 4 5 6 7 8 a = '9' b = 1 2 4 5 6 7 8 9 a = '10' b = 1 2 4 5 6 7 8 9 10 a = '11' b = 1 2 4 5 6 7 8 9 10 11 a = '12' b = 1 2 4 5 6 7 8 9 10 11 12 a = '13' a = '14' b = 1 2 4 5 6 7 8 9 10 11 12 14 a = '15' b = 1 2 4 5 6 7 8 9 10 11 12 14 15 a = '16' b = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 a = '17' b = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 a = '18' b = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 a = '19' b = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 a = '20' b = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 a = '21' b = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 a = '22' b = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 a = '23' a = '24' b = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 24 a = '25' b = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 24 25 a = '26' b = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 24 25 26 a = '27' b = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 24 25 26 27 a = '28' b = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 24 25 26 27 28 a = '29' b = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 24 25 26 27 28 29 a = '30' a = '31' a = '32' a = '33' total = 396