Cody

# Problem 49. Sums with Excluded Digits

Solution 1754020

Submitted on 19 Mar 2019 by Rajpurohith Urmila
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))

x = [] z = [] c = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 x = 1 x = 1 2 x = 1 2 3 x = 1 2 3 4 x = 1 2 3 4 6 x = 1 2 3 4 6 7 x = 1 2 3 4 6 7 8 x = 1 2 3 4 6 7 8 9 x = 1 2 3 4 6 7 8 9 10 x = 1 2 3 4 6 7 8 9 10 11 x = 1 2 3 4 6 7 8 9 10 11 12 x = 1 2 3 4 6 7 8 9 10 11 12 13 x = 1 2 3 4 6 7 8 9 10 11 12 13 14 x = 1 2 3 4 6 7 8 9 10 11 12 13 14 16 x = 1 2 3 4 6 7 8 9 10 11 12 13 14 16 17 x = 1 2 3 4 6 7 8 9 10 11 12 13 14 16 17 18 x = 1 2 3 4 6 7 8 9 10 11 12 13 14 16 17 18 19 x = 1 2 3 4 6 7 8 9 10 11 12 13 14 16 17 18 19 20 z = 1 z = 1 2 z = 1 2 3 z = 1 2 3 4 z = 1 2 3 4 6 z = 1 2 3 4 6 7 z = 1 2 3 4 6 7 8 z = 1 2 3 4 6 7 8 9 z = 1 2 3 4 6 7 8 9 10 z = 1 2 3 4 6 7 8 9 10 11 z = 1 2 3 4 6 7 8 9 10 11 12 z = 1 2 3 4 6 7 8 9 10 11 12 13 z = 1 2 3 4 6 7 8 9 10 11 12 13 14 z = 1 2 3 4 6 7 8 9 10 11 12 13 14 16 z = 1 2 3 4 6 7 8 9 10 11 12 13 14 16 17 z = 1 2 3 4 6 7 8 9 10 11 12 13 14 16 17 18 z = 1 2 3 4 6 7 8 9 10 11 12 13 14 16 17 18 19 z = 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))

x = [] z = [] c = 1 2 3 4 5 6 7 8 9 10 x = 1 x = 1 2 x = 1 2 3 x = 1 2 3 4 x = 1 2 3 4 6 x = 1 2 3 4 6 7 x = 1 2 3 4 6 7 8 x = 1 2 3 4 6 7 8 9 x = 1 2 3 4 6 7 8 9 10 z = 1 z = 1 2 z = 1 2 3 z = 1 2 3 4 z = 1 2 3 4 6 z = 1 2 3 4 6 7 z = 1 2 3 4 6 7 8 z = 1 2 3 4 6 7 8 9 z = 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))

x = [] z = [] c = 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 x = 1 x = 1 2 x = 1 2 4 x = 1 2 4 5 x = 1 2 4 5 6 x = 1 2 4 5 6 7 x = 1 2 4 5 6 7 8 x = 1 2 4 5 6 7 8 9 x = 1 2 4 5 6 7 8 9 10 x = 1 2 4 5 6 7 8 9 10 11 x = 1 2 4 5 6 7 8 9 10 11 12 x = 1 2 4 5 6 7 8 9 10 11 12 14 x = 1 2 4 5 6 7 8 9 10 11 12 14 15 x = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 x = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 x = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 x = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 x = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 x = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 x = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 x = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 24 x = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 24 25 x = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 24 25 26 x = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 24 25 26 27 x = 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 x = 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 x = 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 30 x = 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 30 31 x = 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 30 31 32 z = 1 z = 1 2 z = 1 2 4 z = 1 2 4 5 z = 1 2 4 5 6 z = 1 2 4 5 6 7 z = 1 2 4 5 6 7 8 z = 1 2 4 5 6 7 8 9 z = 1 2 4 5 6 7 8 9 10 z = 1 2 4 5 6 7 8 9 10 11 z = 1 2 4 5 6 7 8 9 10 11 12 z = 1 2 4 5 6 7 8 9 10 11 12 14 z = 1 2 4 5 6 7 8 9 10 11 12 14 15 z = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 z = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 z = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 z = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 z = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 z = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 z = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 z = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 24 z = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 24 25 z = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 24 25 26 z = 1 2 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 24 25 26 27 z = 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 z = 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 total = 396