Cody

Problem 44497. It's Happy! It's Fun! It's Happy Fun Hyperball!

Solution 1481071

Submitted on 6 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
x = 1;y_correct = 8; assert(isequal(happy_fun_hyperball(x),y_correct))

Assertion failed.

2   Fail
x = 2;y_correct = 24; assert(isequal(happy_fun_hyperball(x),y_correct))

Assertion failed.

3   Fail
tic j=0; for flag=1:1000 j=j+happy_fun_hyperball(flag); end toc j assert(isequal(j,2435870608))

Elapsed time is 0.001285 seconds. j = 500500

Assertion failed.

4   Fail
x = 32767;y_correct = 10393302024; assert(isequal(happy_fun_hyperball(x),y_correct))

Assertion failed.

5   Fail
x = 32768;y_correct = 24; assert(isequal(happy_fun_hyperball(x),y_correct))

Assertion failed.

6   Fail
x = 32769;y_correct = 14148064392; assert(isequal(happy_fun_hyperball(x),y_correct))

Assertion failed.

7   Fail
vals=[18744 82424 95784 85704 4392 183768 68712 92456 26232 95928 98952 146328 1368 103064 118872 137144 20904 177144 84984 139992 9672]; k=ceil(21*rand) assert(isequal(happy_fun_hyperball(99+k),vals(k)))

k = 4

Assertion failed.