Cody

Solution 1908125

Submitted on 21 Aug 2019 by Zhichen Zhu
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))

square = 2 str = '2' l = 1 c = '2' x = 2 b = 2

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

square = 1024 str = '1024' l = 4 c = '1' x = 1 c = '10' x = 1 0 c = '102' x = 1 0 2 c = '1024' x = 1 0 2 4 b = 7

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

square = 65536 str = '65536' l = 5 c = '6' x = 6 c = '65' x = 6 5 c = '655' x = 6 5 5 c = '6553' x = 6 5 5 3 c = '65536' x = 6 5 5 3 6 b = 25