Cody

Solution 2065605

Submitted on 20 Dec 2019 by Alistair James
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))

k = 2 y = '2' digits = 1 b = 2

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

k = 1024 y = '1024' digits = 4 total = 0 fig = 1 total = 1 fig = 0 total = 1 fig = 2 total = 3 fig = 4 total = 7

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

k = 65536 y = '65536' digits = 5 total = 0 fig = 6 total = 6 fig = 5 total = 11 fig = 5 total = 16 fig = 3 total = 19 fig = 6 total = 25