Cody

Solution 2068783

Submitted on 25 Dec 2019 by Asif Newaz
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
n = 15; sm_correct = 60; assert(isequal(sum3and5muls(n),sm_correct))

a = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 b = 3 6 9 12 15 c = 5 10 15 d = 3 5 6 9 10 12 15 e = 60

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

a = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 b = 3 6 9 12 15 18 c = 5 10 15 d = 3 5 6 9 10 12 15 18 e = 78

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

a = 1 2 3 b = 3 c = 1×0 empty double row vector d = 3 e = 3

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

a = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 b = 3 6 9 12 15 18 21 24 c = 5 10 15 20 d = 3 5 6 9 10 12 15 18 20 21 24 e = 143