This solution takes advantage of the fact that the ASCII character set is nicely ordered.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
a = 1;
b = 2;
out = sumDigits(a);
assert(isequal(out, b))
ans =
2
|
2 | Pass |
%%
a = 10;
b = 7;
out = sumDigits(a);
assert(isequal(out, b))
ans =
7
|
3 | Pass |
%%
a = 16;
b = 25;
out = sumDigits(a);
assert(isequal(out, b))
ans =
25
|
Swap the first and last columns
9880 Solvers
13791 Solvers
2274 Solvers
Sum of first n terms of a harmonic progression
188 Solvers
Getting the absolute index from a matrix
176 Solvers