Cody

# Problem 1035. Generate a vector like 1,2,2,3,3,3,4,4,4,4

Solution 2000320

Submitted on 2 Nov 2019 by Pravallika T
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 = 2; y_correct = [1 2 2]; assert(isequal(your_fcn_name(x),y_correct))

z = 1 b = [] a = 1 z = 2 ans = 1 b = 1 ans = 1 a = 1 2 z = 3 ans = 1 1 2 b = 1 2 a = 1 2 2 z = 4 ans = 1 2 1 2 2 b = 1 2 2 ans = 1 2 2

2   Pass
x = 5; y_correct = [1 2 2 3 3 3 4 4 4 4 5 5 5 5 5]; assert(isequal(your_fcn_name(x),y_correct))

z = 1 b = [] a = 1 z = 2 ans = 1 b = 1 ans = 1 a = 1 2 z = 3 ans = 1 1 2 b = 1 2 a = 1 2 2 z = 4 ans = 1 2 1 2 2 b = 1 2 2 ans = 1 2 2 a = 1 2 2 3 z = 5 ans = 1 2 2 1 2 2 3 b = 1 2 2 3 a = 1 2 2 3 3 z = 6 ans = 1 2 2 3 1 2 2 3 3 b = 1 2 2 3 3 a = 1 2 2 3 3 3 z = 7 ans = 1 2 2 3 3 1 2 2 3 3 3 b = 1 2 2 3 3 3 ans = 1 2 2 3 3 3 a = 1 2 2 3 3 3 4 z = 8 ans = 1 2 2 3 3 3 1 2 2 3 3 3 4 b = 1 2 2 3 3 3 4 a = 1 2 2 3 3 3 4 4 z = 9 ans = 1 2 2 3 3 3 4 1 2 2 3 3 3 4 4 b = 1 2 2 3 3 3 4 4 a = 1 2 2 3 3 3 4 4 4 z = 10 ans = 1 2 2 3 3 3 4 4 1 2 2 3 3 3 4 4 4 b = 1 2 2 3 3 3 4 4 4 a = 1 2 2 3 3 3 4 4 4 4 z = 11 ans = 1 2 2 3 3 3 4 4 4 1 2 2 3 3 3 4 4 4 4 b = 1 2 2 3 3 3 4 4 4 4 ans = 1 2 2 3 3 3 4 4 4 4 a = 1 2 2 3 3 3 4 4 4 4 5 z = 12 ans = 1 2 2 3 3 3 4 4 4 4 1 2 2 3 3 3 4 4 4 4 5 b = 1 2 2 3 3 3 4 4 4 4 5 a = 1 2 2 3 3 3 4 4 4 4 5 5 z = 13 ans = 1 2 2 3 3 3 4 4 4 4 5 1 2 2 3 3 3 4 4 4 4 5 5 b = 1 2 2 3 3 3 4 4 4 4 5 5 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 z = 14 ans = 1 2 2 3 3 3 4 4 4 4 5 5 1 2 2 3 3 3 4 4 4 4 5 5 5 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 z = 15 ans = 1 2 2 3 3 3 4 4 4 4 5 5 5 1 2 2 3 3 3 4 4 4 4 5 5 5 5 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 z = 16 ans = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 ans = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5

3   Pass
x = 10; y_correct = [1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 ... 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 ... 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10]; assert(isequal(your_fcn_name(x),y_correct))

z = 1 b = [] a = 1 z = 2 ans = 1 b = 1 ans = 1 a = 1 2 z = 3 ans = 1 1 2 b = 1 2 a = 1 2 2 z = 4 ans = 1 2 1 2 2 b = 1 2 2 ans = 1 2 2 a = 1 2 2 3 z = 5 ans = 1 2 2 1 2 2 3 b = 1 2 2 3 a = 1 2 2 3 3 z = 6 ans = 1 2 2 3 1 2 2 3 3 b = 1 2 2 3 3 a = 1 2 2 3 3 3 z = 7 ans = 1 2 2 3 3 1 2 2 3 3 3 b = 1 2 2 3 3 3 ans = 1 2 2 3 3 3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 2 3 3 3 4 4 4 4 5 5 5 5 5 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 Column 31 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 z = 18 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 1 2 2 3 3 3 4 4 4 4 5 5 5 5 Columns 31 through 33 5 6 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 z = 19 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 1 2 2 3 3 3 4 4 4 4 5 5 5 Columns 31 through 35 5 5 6 6 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 z = 20 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 1 2 2 3 3 3 4 4 4 4 5 5 Columns 31 through 37 5 5 5 6 6 6 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 z = 21 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 1 2 2 3 3 3 4 4 4 4 5 Columns 31 through 39 5 5 5 5 6 6 6 6 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 z = 22 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 1 2 2 3 3 3 4 4 4 4 Columns 31 through 41 5 5 5 5 5 6 6 6 6 6 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 ans = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 z = 23 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 1 2 2 3 3 3 4 4 4 Columns 31 through 43 4 5 5 5 5 5 6 6 6 6 6 6 7 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 z = 24 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 1 2 2 3 3 3 4 4 Columns 31 through 45 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 z = 25 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 1 2 2 3 3 3 4 Columns 31 through 47 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 z = 26 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 1 2 2 3 3 3 Columns 31 through 49 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 z = 27 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 1 2 2 3 3 Columns 31 through 51 3 ...

4   Pass
x = 12; y_correct = [1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 ... 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 ... 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 ... 11 11 11 11 11 11 11 11 11 11 11 ... 12 12 12 12 12 12 12 12 12 12 12 12]; assert(isequal(your_fcn_name(x),y_correct))

z = 1 b = [] a = 1 z = 2 ans = 1 b = 1 ans = 1 a = 1 2 z = 3 ans = 1 1 2 b = 1 2 a = 1 2 2 z = 4 ans = 1 2 1 2 2 b = 1 2 2 ans = 1 2 2 a = 1 2 2 3 z = 5 ans = 1 2 2 1 2 2 3 b = 1 2 2 3 a = 1 2 2 3 3 z = 6 ans = 1 2 2 3 1 2 2 3 3 b = 1 2 2 3 3 a = 1 2 2 3 3 3 z = 7 ans = 1 2 2 3 3 1 2 2 3 3 3 b = 1 2 2 3 3 3 ans = 1 2 2 3 3 3 a = 1 2 2 3 3 3 4 z = 8 ans = 1 2 2 3 3 3 1 2 2 3 3 3 4 b = 1 2 2 3 3 3 4 a = 1 2 2 3 3 3 4 4 z = 9 ans = 1 2 2 3 3 3 4 1 2 2 3 3 3 4 4 b = 1 2 2 3 3 3 4 4 a = 1 2 2 3 3 3 4 4 4 z = 10 ans = 1 2 2 3 3 3 4 4 1 2 2 3 3 3 4 4 4 b = 1 2 2 3 3 3 4 4 4 a = 1 2 2 3 3 3 4 4 4 4 z = 11 ans = 1 2 2 3 3 3 4 4 4 1 2 2 3 3 3 4 4 4 4 b = 1 2 2 3 3 3 4 4 4 4 ans = 1 2 2 3 3 3 4 4 4 4 a = 1 2 2 3 3 3 4 4 4 4 5 z = 12 ans = 1 2 2 3 3 3 4 4 4 4 1 2 2 3 3 3 4 4 4 4 5 b = 1 2 2 3 3 3 4 4 4 4 5 a = 1 2 2 3 3 3 4 4 4 4 5 5 z = 13 ans = 1 2 2 3 3 3 4 4 4 4 5 1 2 2 3 3 3 4 4 4 4 5 5 b = 1 2 2 3 3 3 4 4 4 4 5 5 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 z = 14 ans = 1 2 2 3 3 3 4 4 4 4 5 5 1 2 2 3 3 3 4 4 4 4 5 5 5 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 z = 15 ans = 1 2 2 3 3 3 4 4 4 4 5 5 5 1 2 2 3 3 3 4 4 4 4 5 5 5 5 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 z = 16 ans = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 ans = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 z = 17 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 Column 31 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 z = 18 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 1 2 2 3 3 3 4 4 4 4 5 5 5 5 Columns 31 through 33 5 6 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 z = 19 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 1 2 2 3 3 3 4 4 4 4 5 5 5 Columns 31 through 35 5 5 6 6 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 z = 20 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 1 2 2 3 3 3 4 4 4 4 5 5 Columns 31 through 37 5 5 5 6 6 6 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 z = 21 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 1 2 2 3 3 3 4 4 4 4 5 Columns 31 through 39 5 5 5 5 6 6 6 6 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 z = 22 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 1 2 2 3 3 3 4 4 4 4 Columns 31 through 41 5 5 5 5 5 6 6 6 6 6 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 ans = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 z = 23 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 1 2 2 3 3 3 4 4 4 Columns 31 through 43 4 5 5 5 5 5 6 6 6 6 6 6 7 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 z = 24 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 1 2 2 3 3 3 4 4 Columns 31 through 45 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 z = 25 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 1 2 2 3 3 3 4 Columns 31 through 47 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 z = 26 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 1 2 2 3 3 3 Columns 31 through 49 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 z = 27 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 1 2 2 3 3 Columns 31 through 51 3 ...

5   Pass
x = 9; y_correct = [1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 ... 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 ... 9 9 9 9 9 9 9 9 9]; assert(isequal(your_fcn_name(x),y_correct))

z = 1 b = [] a = 1 z = 2 ans = 1 b = 1 ans = 1 a = 1 2 z = 3 ans = 1 1 2 b = 1 2 a = 1 2 2 z = 4 ans = 1 2 1 2 2 b = 1 2 2 ans = 1 2 2 a = 1 2 2 3 z = 5 ans = 1 2 2 1 2 2 3 b = 1 2 2 3 a = 1 2 2 3 3 z = 6 ans = 1 2 2 3 1 2 2 3 3 b = 1 2 2 3 3 a = 1 2 2 3 3 3 z = 7 ans = 1 2 2 3 3 1 2 2 3 3 3 b = 1 2 2 3 3 3 ans = 1 2 2 3 3 3 a = 1 2 2 3 3 3 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 5 5 5 5 5 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 Column 31 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 z = 18 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 1 2 2 3 3 3 4 4 4 4 5 5 5 5 Columns 31 through 33 5 6 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 z = 19 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 1 2 2 3 3 3 4 4 4 4 5 5 5 Columns 31 through 35 5 5 6 6 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 z = 20 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 1 2 2 3 3 3 4 4 4 4 5 5 Columns 31 through 37 5 5 5 6 6 6 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 z = 21 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 1 2 2 3 3 3 4 4 4 4 5 Columns 31 through 39 5 5 5 5 6 6 6 6 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 z = 22 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 1 2 2 3 3 3 4 4 4 4 Columns 31 through 41 5 5 5 5 5 6 6 6 6 6 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 ans = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 z = 23 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 1 2 2 3 3 3 4 4 4 Columns 31 through 43 4 5 5 5 5 5 6 6 6 6 6 6 7 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 z = 24 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 1 2 2 3 3 3 4 4 Columns 31 through 45 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 z = 25 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 1 2 2 3 3 3 4 Columns 31 through 47 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 z = 26 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 1 2 2 3 3 3 Columns 31 through 49 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 z = 27 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 1 2 2 3 3 Columns 31 through 51 3 ...

6   Pass
x = 7; y_correct = [1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 ... 6 6 6 6 6 6 7 7 7 7 7 7 7]; assert(isequal(your_fcn_name(x),y_correct))

z = 1 b = [] a = 1 z = 2 ans = 1 b = 1 ans = 1 a = 1 2 z = 3 ans = 1 1 2 b = 1 2 a = 1 2 2 z = 4 ans = 1 2 1 2 2 b = 1 2 2 ans = 1 2 2 a = 1 2 2 3 z = 5 ans = 1 2 2 1 2 2 3 b = 1 2 2 3 a = 1 2 2 3 3 z = 6 ans = 1 2 2 3 1 2 2 3 3 b = 1 2 2 3 3 a = 1 2 2 3 3 3 z = 7 ans = 1 2 2 3 3 1 2 2 3 3 3 b = 1 2 2 3 3 3 ans = 1 2 2 3 3 3 a = 1 2 2 3 3 3 4 z = 8 ans = 1 2 2 3 3 3 1 2 2 3 3 3 4 b = 1 2 2 3 3 3 4 a = 1 2 2 3 3 3 4 4 z = 9 ans = 1 2 2 3 3 3 4 1 2 2 3 3 3 4 4 b = 1 2 2 3 3 3 4 4 a = 1 2 2 3 3 3 4 4 4 z = 10 ans = 1 2 2 3 3 3 4 4 1 2 2 3 3 3 4 4 4 b = 1 2 2 3 3 3 4 4 4 a = 1 2 2 3 3 3 4 4 4 4 z = 11 ans = 1 2 2 3 3 3 4 4 4 1 2 2 3 3 3 4 4 4 4 b = 1 2 2 3 3 3 4 4 4 4 ans = 1 2 2 3 3 3 4 4 4 4 a = 1 2 2 3 3 3 4 4 4 4 5 z = 12 ans = 1 2 2 3 3 3 4 4 4 4 1 2 2 3 3 3 4 4 4 4 5 b = 1 2 2 3 3 3 4 4 4 4 5 a = 1 2 2 3 3 3 4 4 4 4 5 5 z = 13 ans = 1 2 2 3 3 3 4 4 4 4 5 1 2 2 3 3 3 4 4 4 4 5 5 b = 1 2 2 3 3 3 4 4 4 4 5 5 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 z = 14 ans = 1 2 2 3 3 3 4 4 4 4 5 5 1 2 2 3 3 3 4 4 4 4 5 5 5 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 z = 15 ans = 1 2 2 3 3 3 4 4 4 4 5 5 5 1 2 2 3 3 3 4 4 4 4 5 5 5 5 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 z = 16 ans = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 ans = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 z = 17 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 Column 31 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 z = 18 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 1 2 2 3 3 3 4 4 4 4 5 5 5 5 Columns 31 through 33 5 6 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 z = 19 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 1 2 2 3 3 3 4 4 4 4 5 5 5 Columns 31 through 35 5 5 6 6 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 z = 20 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 1 2 2 3 3 3 4 4 4 4 5 5 Columns 31 through 37 5 5 5 6 6 6 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 z = 21 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 1 2 2 3 3 3 4 4 4 4 5 Columns 31 through 39 5 5 5 5 6 6 6 6 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 z = 22 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 1 2 2 3 3 3 4 4 4 4 Columns 31 through 41 5 5 5 5 5 6 6 6 6 6 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 ans = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 z = 23 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 1 2 2 3 3 3 4 4 4 Columns 31 through 43 4 5 5 5 5 5 6 6 6 6 6 6 7 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 z = 24 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 1 2 2 3 3 3 4 4 Columns 31 through 45 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 z = 25 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 1 2 2 3 3 3 4 Columns 31 through 47 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 z = 26 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 1 2 2 3 3 3 Columns 31 through 49 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 z = 27 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 1 2 2 3 3 Columns 31 through 51 3 ...

7   Pass
x = 15; y_correct = [1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 ... 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 ... 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 ... 11 11 11 11 11 11 11 11 11 11 11 ... 12 12 12 12 12 12 12 12 12 12 12 12 ... 13 13 13 13 13 13 13 13 13 13 13 13 13 ... 14 14 14 14 14 14 14 14 14 14 14 14 14 14 ... 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15]; assert(isequal(your_fcn_name(x),y_correct))

z = 1 b = [] a = 1 z = 2 ans = 1 b = 1 ans = 1 a = 1 2 z = 3 ans = 1 1 2 b = 1 2 a = 1 2 2 z = 4 ans = 1 2 1 2 2 b = 1 2 2 ans = 1 2 2 a = 1 2 2 3 z = 5 ans = 1 2 2 1 2 2 3 b = 1 2 2 3 a = 1 2 2 3 3 z = 6 ans = 1 2 2 3 1 2 2 3 3 b = 1 2 2 3 3 a = 1 2 2 3 3 3 z = 7 ans = 1 2 2 3 3 1 2 2 3 3 3 b = 1 2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 6 z = 17 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 Column 31 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 z = 18 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 1 2 2 3 3 3 4 4 4 4 5 5 5 5 Columns 31 through 33 5 6 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 z = 19 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 1 2 2 3 3 3 4 4 4 4 5 5 5 Columns 31 through 35 5 5 6 6 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 z = 20 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 1 2 2 3 3 3 4 4 4 4 5 5 Columns 31 through 37 5 5 5 6 6 6 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 z = 21 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 1 2 2 3 3 3 4 4 4 4 5 Columns 31 through 39 5 5 5 5 6 6 6 6 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 z = 22 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 1 2 2 3 3 3 4 4 4 4 Columns 31 through 41 5 5 5 5 5 6 6 6 6 6 6 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 ans = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 z = 23 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 1 2 2 3 3 3 4 4 4 Columns 31 through 43 4 5 5 5 5 5 6 6 6 6 6 6 7 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 z = 24 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 1 2 2 3 3 3 4 4 Columns 31 through 45 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 z = 25 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 1 2 2 3 3 3 4 Columns 31 through 47 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 z = 26 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 1 2 2 3 3 3 Columns 31 through 49 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 b = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 a = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 z = 27 ans = Columns 1 through 30 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 1 2 2 3 3 Columns 31 through 51 3 ...