Cody

Solution 1404519

Submitted on 4 Jan 2018 by Thiago César
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))

int = 2 comp = 1 vec = 2 b = 2

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

int = 1024 comp = 4 vec = 4 0 0 0 b = 4 vec = 4 20 0 0 sum = 24 b = 6 vec = 4 20 0 0 sum = 24 b = 6 vec = 4 20 0 1000 sum = 1024 b = 7

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

int = 65536 comp = 5 vec = 6 0 0 0 0 b = 6 vec = 6 30 0 0 0 sum = 36 b = 9 vec = 6 30 500 0 0 sum = 536 b = 14 vec = 6 30 500 5000 0 sum = 5536 b = 19 vec = 6 30 500 5000 60000 sum = 65536 b = 25