Cody

Solution 1734407

Submitted on 23 Feb 2019
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   Fail
n = 15; sm_correct = 60; assert(isequal(sum3and5muls(n),sm_correct))

li = [] li = 1 li = 1 3 li = 1 3 5 li = 1 3 5 15 sum_mult = 24

Assertion failed.

2   Fail
n = 18; sm_correct = 78; assert(isequal(sum3and5muls(n),sm_correct))

li = [] li = 1 li = 1 2 li = 1 2 3 li = 1 2 3 6 li = 1 2 3 6 9 li = 1 2 3 6 9 18 sum_mult = 39

Assertion failed.

3   Fail
n = (2^2)-1; sm_correct = 3; assert(isequal(sum3and5muls(n),sm_correct))

li = [] li = 1 li = 1 3 sum_mult = 4

Assertion failed.

4   Fail
n = randi(25); sm_correct = sum(3:3:n)+sum(5:5:n)-sum(15:15:n); assert(isequal(sum3and5muls(n),sm_correct))

li = [] li = 1 li = 1 2 li = 1 2 4 li = 1 2 4 8 li = 1 2 4 8 16 sum_mult = 31

Assertion failed.