Cody

# Problem 44532. Funny problems

Solution 2068710

Submitted on 24 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
x = 1; y = 1; assert(isequal(funny(x),y))

q = 1

2   Pass
x=2; y=[2 2 1]; assert(isequal(funny(x),y))

q = 2 2 q = 2 2 1

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

x = 5 q = 5 5 5 5 5 q = 5 5 5 5 5 4 4 4 4 q = 5 5 5 5 5 4 4 4 4 3 3 3 q = 5 5 5 5 5 4 4 4 4 3 3 3 2 2 q = 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1

4   Pass
x=10; y=[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 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]; assert(isequal(funny(x),y))

q = 10 10 10 10 10 10 10 10 10 10 q = 10 10 10 10 10 10 10 10 10 10 9 9 9 9 9 9 9 9 9 q = 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 q = 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 34 7 7 7 7 q = 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 40 7 7 7 7 6 6 6 6 6 6 q = 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 45 7 7 7 7 6 6 6 6 6 6 5 5 5 5 5 q = 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 49 7 7 7 7 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 q = 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 52 7 7 7 7 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 3 3 3 q = 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 54 7 7 7 7 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 3 3 3 2 2 q = 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

5   Pass
filetext = fileread('funny.m'); assert(isempty(strfind(filetext, 'if')),'if forbidden')