Cody

Solution 1546825

Submitted on 2 Jun 2018 by Binbin Qi
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 = 12; x = [2 3]; v_correct = [1 2 4 5 8 10 12 14 15 16 19 20]; assert(isequal(segnum(n,x),v_correct))

2   Pass
n = 22; x = 0; v_correct = [1 2 4 5 8 10 14 15 16 21 22 25 26 28 33 34 35 36 38 40 42 46]; assert(isequal(segnum(n,x),v_correct))

3   Pass
n = 15; x = [2 4]; v_correct = [1 2 4 5 7 8 10 11 13 14 16 17 19 20 22]; assert(isequal(segnum(n,x),v_correct))

4   Pass
n = 23; x = [2 3 5 6]; v_correct = [1 2 4 5 8 10 12 14 15 16 19 21 24 25 27 28 32 33 34 37 38 42 43]; assert(isequal(segnum(n,x),v_correct))