Extremely clever! Why didn't I think of that!?
Great: to transpose a char row into a char column makes the work...
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
|
6063 Solvers
4106 Solvers
1726 Solvers
379 Solvers
Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock.
761 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!