Cody

# Problem 44532. Funny problems

Solution 1688113

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

Error in solution Line: 8 Column: 1 This statement is not inside any function. (It follows the END that terminates the definition of the function "funny".)

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

Error in solution Line: 8 Column: 1 This statement is not inside any function. (It follows the END that terminates the definition of the function "funny".)

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

Error in solution Line: 8 Column: 1 This statement is not inside any function. (It follows the END that terminates the definition of the function "funny".)

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

Error in solution Line: 8 Column: 1 This statement is not inside any function. (It follows the END that terminates the definition of the function "funny".)

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

Error in solution Line: 8 Column: 1 This statement is not inside any function. (It follows the END that terminates the definition of the function "funny".)