Cody

# Problem 49. Sums with Excluded Digits

Solution 1922615

Submitted on 5 Sep 2019 by Adi Ben Hayun
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))

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

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

total = 0 ans = '1' ans = logical 0 total = 1 ans = '2' ans = logical 0 total = 3 ans = '3' ans = logical 0 total = 6 ans = '4' ans = logical 0 total = 10 ans = '5' ans = logical 0 ans = '6' ans = logical 0 total = 16 ans = '7' ans = logical 0 total = 23 ans = '8' ans = logical 0 total = 31 ans = '9' ans = logical 0 total = 40 ans = '10' ans = 1×2 logical array 0 0 total = 50

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

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