Cody

# Problem 44523. Pattern Sum

Solution 2077961

Submitted on 3 Jan 2020 by Nikolaos Nikolaou
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
a = 4; b = 5; y_correct = 49380; assert(isequal(pattern_sum(a,b),y_correct))

a = '4' n = 0×0 empty char array l = [] n = '4' l = 4 n = '44' l = 4 44 n = '444' l = 4 44 444 n = '4444' l = 4 44 444 4444 n = '44444' l = 4 44 444 4444 44444 y = 49380

2   Pass
a = 7; b = 4; y_correct = 8638; assert(isequal(pattern_sum(a,b),y_correct))

a = '7' n = 0×0 empty char array l = [] n = '7' l = 7 n = '77' l = 7 77 n = '777' l = 7 77 777 n = '7777' l = 7 77 777 7777 y = 8638

3   Pass
a = 5; b = 3; y_correct = 615; assert(isequal(pattern_sum(a,b),y_correct))

a = '5' n = 0×0 empty char array l = [] n = '5' l = 5 n = '55' l = 5 55 n = '555' l = 5 55 555 y = 615

4   Pass
a = 1; b = 1; y_correct = 1; assert(isequal(pattern_sum(a,b),y_correct))

a = '1' n = 0×0 empty char array l = [] n = '1' l = 1 y = 1

5   Pass
a = 2; b = 2; y_correct = 24; assert(isequal(pattern_sum(a,b),y_correct))

a = '2' n = 0×0 empty char array l = [] n = '2' l = 2 n = '22' l = 2 22 y = 24

6   Pass
a = 9; b = 9; y_correct = 1111111101; assert(isequal(pattern_sum(a,b),y_correct))

a = '9' n = 0×0 empty char array l = [] n = '9' l = 9 n = '99' l = 9 99 n = '999' l = 9 99 999 n = '9999' l = 9 99 999 9999 n = '99999' l = 9 99 999 9999 99999 n = '999999' l = 9 99 999 9999 99999 999999 n = '9999999' l = 9 99 999 9999 99999 999999 9999999 n = '99999999' l = 9 99 999 9999 99999 999999 9999999 99999999 n = '999999999' l = 9 99 999 9999 99999 999999 9999999 99999999 999999999 y = 1.1111e+09

7   Pass
a = 0; b = 0; y_correct = 0; assert(isequal(pattern_sum(a,b),y_correct))

a = '0' n = 0×0 empty char array l = [] y = 0

8   Pass
a = 3; b = 8; y_correct = 37037034; assert(isequal(pattern_sum(a,b),y_correct))

a = '3' n = 0×0 empty char array l = [] n = '3' l = 3 n = '33' l = 3 33 n = '333' l = 3 33 333 n = '3333' l = 3 33 333 3333 n = '33333' l = 3 33 333 3333 33333 n = '333333' l = 3 33 333 3333 33333 333333 n = '3333333' l = 3 33 333 3333 33333 333333 3333333 n = '33333333' l = 3 33 333 3333 33333 333333 3333333 33333333 y = 37037034