Cody

Solution 2075845

Submitted on 1 Jan 2020 by Andreas Neul
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 = 1; b = 2; out = sumDigits(a); assert(isequal(out, b))

b1char = '2' b1len = 1 b2 = 0 b2 = 2 b = 2

2   Pass
a = 10; b = 7; out = sumDigits(a); assert(isequal(out, b))

b1char = '1024' b1len = 4 b2 = 0 0 0 0 b2 = 1 0 0 0 b2 = 1 0 0 0 b2 = 1 0 2 0 b2 = 1 0 2 4 b = 7

3   Pass
a = 16; b = 25; out = sumDigits(a); assert(isequal(out, b))

b1char = '65536' b1len = 5 b2 = 0 0 0 0 0 b2 = 6 0 0 0 0 b2 = 6 5 0 0 0 b2 = 6 5 5 0 0 b2 = 6 5 5 3 0 b2 = 6 5 5 3 6 b = 25