Cody

Solution 1980161

Submitted on 17 Oct 2019 by Nikolaos Nikolaou
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 = 13; y_correct = 20; assert(isequal(candyCount(n),y_correct))

s = 1 2 3 4 5 6 7 8 9 10 11 12 13 m = 1 0 1 0 1 0 1 0 1 0 1 0 1 m = 2 0 2 0 2 0 2 0 2 0 2 0 2 m = 2 1 2 1 2 1 2 1 2 1 2 1 2 x = 20

2   Pass
n = 24; y_correct = 36; assert(isequal(candyCount(n),y_correct))

s = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 m = 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 m = 2 0 2 0 2 0 2 0 2 0 2 0 2 0 2 0 2 0 2 0 2 0 2 0 m = 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 x = 36

Suggested Problems

More from this Author1