Cody

# Problem 2053. Strange Number Algorithms

Solution 1486229

Submitted on 10 Apr 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
n = [1 10 100]; a(1)=(((n(1)*3)+6)/3)-n(1); a(2)=(((n(2)*2)+9)-3)/2-n(2); a(3)=(((n(3)+7)*2)-4)/2-n(3); y_correct = a; assert(isequal(strange(n),y_correct))

n = 2 10 100

Output argument "amat" (and maybe others) not assigned during call to "strange". Error in Test1 (line 6) assert(isequal(strange(n),y_correct))

2   Fail
n = [0 499 999]; a(1)=(((n(1)*3)+6)/3)-n(1); a(2)=(((n(2)*2)+9)-3)/2-n(2); a(3)=(((n(3)+7)*2)-4)/2-n(3); y_correct = a; assert(isequal(strange(n),y_correct))

n = 2 499 999

Output argument "amat" (and maybe others) not assigned during call to "strange". Error in Test2 (line 6) assert(isequal(strange(n),y_correct))

3   Fail
n = [999 666 333]; a(1)=(((n(1)*3)+6)/3)-n(1); a(2)=(((n(2)*2)+9)-3)/2-n(2); a(3)=(((n(3)+7)*2)-4)/2-n(3); y_correct = a; assert(isequal(strange(n),y_correct))

n = 2 666 333

Output argument "amat" (and maybe others) not assigned during call to "strange". Error in Test3 (line 6) assert(isequal(strange(n),y_correct))

4   Fail
n = [7 63 347]; a(1)=(((n(1)*3)+6)/3)-n(1); a(2)=(((n(2)*2)+9)-3)/2-n(2); a(3)=(((n(3)+7)*2)-4)/2-n(3); y_correct = a; assert(isequal(strange(n),y_correct))

n = 2 63 347

Output argument "amat" (and maybe others) not assigned during call to "strange". Error in Test4 (line 6) assert(isequal(strange(n),y_correct))

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!