Cody

Solution 1945192

Submitted on 21 Sep 2019
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 = 12;y_correct = 3; assert(isequal(PSR(x),y_correct))

y = 3

2   Fail
x = 3102;y_correct = 47; assert(isequal(PSR(x),y_correct))

y = 55

Assertion failed.

3   Pass
x=10000;y_correct = 100; assert(isequal(PSR(x),y_correct))

y = 100

4   Fail
x=1308276133167003;y_correct = 36105377; assert(isequal(PSR(x),y_correct))

y = 36170099

Assertion failed.

5   Fail
x=6469693230;y_correct = 79534; assert(isequal(PSR(x),y_correct))

y = 80434

Assertion failed.

6   Fail
p=cumprod(1:10); y=arrayfun(@(p) PSR(p),p); y_correct=[1 1 2 4 10 24 70 192 576 1890]; assert(isequal(y,y_correct))

y = 1 y = 1 y = 2 y = 4 y = 10 y = 26 y = 70 y = 200 y = 602 y = 1904

Assertion failed.

7   Pass
x=1000000000000002; assert(isequal(PSR(PSR(x)),2))

y = 4 y = 2