Cody

Solution 2157226

Submitted on 12 Mar 2020 by Wang Jasper
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))

f = [] p = 1 f = 1 p = 2 2 f = 2 2 1 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))

f = [] p = 1 f = 1 p = 2 2 f = 2 2 1 p = 3 3 3 f = 3 3 3 2 2 1 p = 4 4 4 4 f = 4 4 4 4 3 3 3 2 2 1 p = 5 5 5 5 5 f = 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 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))

f = [] p = 1 f = 1 p = 2 2 f = 2 2 1 p = 3 3 3 f = 3 3 3 2 2 1 p = 4 4 4 4 f = 4 4 4 4 3 3 3 2 2 1 p = 5 5 5 5 5 f = 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 p = 6 6 6 6 6 6 f = 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 p = 7 7 7 7 7 7 7 f = 7 7 7 7 7 7 7 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 p = 8 8 8 8 8 8 8 8 f = Columns 1 through 30 8 8 8 8 8 8 8 8 7 7 7 7 7 7 7 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 Columns 31 through 36 3 3 3 2 2 1 p = 9 9 9 9 9 9 9 9 9 f = Columns 1 through 30 9 9 9 9 9 9 9 9 9 8 8 8 8 8 8 8 8 7 7 7 7 7 7 7 6 6 6 6 6 6 Columns 31 through 45 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 p = 10 10 10 10 10 10 10 10 10 10 f = Columns 1 through 30 10 10 10 10 10 10 10 10 10 10 9 9 9 9 9 9 9 9 9 8 8 8 8 8 8 8 8 7 7 7 Columns 31 through 55 7 7 7 7 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 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 7 7 7 8 8 Columns 31 through 55 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

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))

f = [] p = 1 f = 1 p = 2 2 f = 2 2 1 p = 3 3 3 f = 3 3 3 2 2 1 p = 4 4 4 4 f = 4 4 4 4 3 3 3 2 2 1 p = 5 5 5 5 5 f = 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 p = 6 6 6 6 6 6 f = 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 p = 7 7 7 7 7 7 7 f = 7 7 7 7 7 7 7 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 p = 8 8 8 8 8 8 8 8 f = Columns 1 through 30 8 8 8 8 8 8 8 8 7 7 7 7 7 7 7 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 Columns 31 through 36 3 3 3 2 2 1 p = 9 9 9 9 9 9 9 9 9 f = Columns 1 through 30 9 9 9 9 9 9 9 9 9 8 8 8 8 8 8 8 8 7 7 7 7 7 7 7 6 6 6 6 6 6 Columns 31 through 45 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 p = 10 10 10 10 10 10 10 10 10 10 f = Columns 1 through 30 10 10 10 10 10 10 10 10 10 10 9 9 9 9 9 9 9 9 9 8 8 8 8 8 8 8 8 7 7 7 Columns 31 through 55 7 7 7 7 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 p = 11 11 11 11 11 11 11 11 11 11 11 f = Columns 1 through 30 11 11 11 11 11 11 11 11 11 11 11 10 10 10 10 10 10 10 10 10 10 9 9 9 9 9 9 9 9 9 Columns 31 through 60 8 8 8 8 8 8 8 8 7 7 7 7 7 7 7 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 Columns 61 through 66 3 3 3 2 2 1 p = 12 12 12 12 12 12 12 12 12 12 12 12 f = Columns 1 through 30 12 12 12 12 12 12 12 12 12 12 12 12 11 11 11 11 11 11 11 11 11 11 11 10 10 10 10 10 10 10 Columns 31 through 60 10 10 10 9 9 9 9 9 9 9 9 9 8 8 8 8 8 8 8 8 7 7 7 7 7 7 7 6 6 6 Columns 61 through 78 6 6 6 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 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 7 7 7 8 8 Columns 31 through 60 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 Columns 61 through 78 11 11 11 11 11 11 12 12 12 12 12 12 12 12 12 12 12 12

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))

f = [] p = 1 f = 1 p = 2 2 f = 2 2 1 p = 3 3 3 f = 3 3 3 2 2 1 p = 4 4 4 4 f = 4 4 4 4 3 3 3 2 2 1 p = 5 5 5 5 5 f = 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 p = 6 6 6 6 6 6 f = 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 p = 7 7 7 7 7 7 7 f = 7 7 7 7 7 7 7 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 p = 8 8 8 8 8 8 8 8 f = Columns 1 through 30 8 8 8 8 8 8 8 8 7 7 7 7 7 7 7 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 Columns 31 through 36 3 3 3 2 2 1 p = 9 9 9 9 9 9 9 9 9 f = Columns 1 through 30 9 9 9 9 9 9 9 9 9 8 8 8 8 8 8 8 8 7 7 7 7 7 7 7 6 6 6 6 6 6 Columns 31 through 45 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 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 7 7 7 8 8 Columns 31 through 45 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9

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))

f = [] p = 1 f = 1 p = 2 2 f = 2 2 1 p = 3 3 3 f = 3 3 3 2 2 1 p = 4 4 4 4 f = 4 4 4 4 3 3 3 2 2 1 p = 5 5 5 5 5 f = 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 p = 6 6 6 6 6 6 f = 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 p = 7 7 7 7 7 7 7 f = 7 7 7 7 7 7 7 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 ans = 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

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))

f = [] p = 1 f = 1 p = 2 2 f = 2 2 1 p = 3 3 3 f = 3 3 3 2 2 1 p = 4 4 4 4 f = 4 4 4 4 3 3 3 2 2 1 p = 5 5 5 5 5 f = 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 p = 6 6 6 6 6 6 f = 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 p = 7 7 7 7 7 7 7 f = 7 7 7 7 7 7 7 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 p = 8 8 8 8 8 8 8 8 f = Columns 1 through 30 8 8 8 8 8 8 8 8 7 7 7 7 7 7 7 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 Columns 31 through 36 3 3 3 2 2 1 p = 9 9 9 9 9 9 9 9 9 f = Columns 1 through 30 9 9 9 9 9 9 9 9 9 8 8 8 8 8 8 8 8 7 7 7 7 7 7 7 6 6 6 6 6 6 Columns 31 through 45 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 p = 10 10 10 10 10 10 10 10 10 10 f = Columns 1 through 30 10 10 10 10 10 10 10 10 10 10 9 9 9 9 9 9 9 9 9 8 8 8 8 8 8 8 8 7 7 7 Columns 31 through 55 7 7 7 7 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 p = 11 11 11 11 11 11 11 11 11 11 11 f = Columns 1 through 30 11 11 11 11 11 11 11 11 11 11 11 10 10 10 10 10 10 10 10 10 10 9 9 9 9 9 9 9 9 9 Columns 31 through 60 8 8 8 8 8 8 8 8 7 7 7 7 7 7 7 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 Columns 61 through 66 3 3 3 2 2 1 p = 12 12 12 12 12 12 12 12 12 12 12 12 f = Columns 1 through 30 12 12 12 12 12 12 12 12 12 12 12 12 11 11 11 11 11 11 11 11 11 11 11 10 10 10 10 10 10 10 Columns 31 through 60 10 10 10 9 9 9 9 9 9 9 9 9 8 8 8 8 8 8 8 8 7 7 7 7 7 7 7 6 6 6 Columns 61 through 78 6 6 6 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 p = 13 13 13 13 13 13 13 13 13 13 13 13 13 f = Columns 1 through 30 13 13 13 13 13 13 13 13 13 13 13 13 13 12 12 12 12 12 12 12 12 12 12 12 12 11 11 11 11 11 Columns 31 through 60 11 11 11 11 11 11 10 10 10 10 10 10 10 10 10 10 9 9 9 9 9 9 9 9 9 8 8 8 8 8 Columns 61 through 90 8 8 8 7 7 7 7 7 7 7 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 3 3 3 2 2 Column 91 1 p = 14 14 14 14 14 14 14 14 14 14 14 14 14 14 f = Columns 1 through 30 14 14 14 14 14 14 14 14 14 14 14 14 14 14 13 13 13 13 13 13 13 13 13 13 13 13 13 12 12 12 Columns 31 through 60 12 12 12 12 12 12 12 12 12 11 11 11 11 11 11 11 11 11 11 11 10 10 10 10 10 10 10 10 10 10 Columns 61 through 90 9 9 9 9 9 9 9 9 9 8 8 8 8 8 8 8 8 7 7 7 7 7 7 7 6 6 6 6 6 6 Columns 91 through 105 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 p = 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 f = Columns 1 through 30 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 14 14 14 14 14 14 14 14 14 14 14 14 14 14 13 Columns 31 through 60 13 13 13 13 13 13 13 13 13 13 13 13 12 12 12 12 12 12 12 12 12 12 12 12 11 11 11 11 11 11 Columns 61 through 90 11 11 11 11 11 10 10 10 10 10 10 10 10 10 10 9 9 9 9 9 9 9 9 9 8 8 8 8 8 8 Columns 91 through 120 8 8 7 7 7 7 7 7 7 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 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 7 7 7 8 8 Columns 31 through 60 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 Columns 61 through 90 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 Columns 91 through 120 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