Cody

Solution 2655644

Submitted on 5 Jul 2020
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))

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   Fail
x = -431; y_correct = 64; assert(isequal(sq_sum(x),y_correct))

sum = 0

Assertion failed.