Cody

Solution 2655647

Submitted on 5 Jul 2020 by Ramesh Kumar V
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
x = 35431; y_correct = 256; assert(isequal(sq_sum(x),y_correct))

a = 35431 sum = 0 m = 1 sum = 1 a = 3543 m = 3 sum = 4 a = 354 m = 4 sum = 8 a = 35 m = 5 sum = 13 a = 3 m = 3 sum = 16 a = 0

2   Pass
x = -431; y_correct = 64; assert(isequal(sq_sum(x),y_correct))

a = 431 sum = 0 m = 1 sum = 1 a = 43 m = 3 sum = 4 a = 4 m = 4 sum = 8 a = 0

Suggested Problems

More from this Author9