Cody

# Problem 42460. The cake is a lie...

Solution 1956720

Submitted on 2 Oct 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   Fail
x = 1;y_correct = 0; assert(isequal(birthday_cake(x),y_correct))

Undefined function 'birthday_cake' for input arguments of type 'double'. Error in Test1 (line 2) assert(isequal(birthday_cake(x),y_correct))

2   Fail
x = 2;y_correct = 1; assert(isequal(birthday_cake(x),y_correct))

Undefined function 'birthday_cake' for input arguments of type 'double'. Error in Test2 (line 2) assert(isequal(birthday_cake(x),y_correct))

3   Fail
x = 4;y_correct = 2; assert(isequal(birthday_cake(x),y_correct))

Undefined function 'birthday_cake' for input arguments of type 'double'. Error in Test3 (line 2) assert(isequal(birthday_cake(x),y_correct))

4   Fail
x = 7;y_correct = 3; assert(isequal(birthday_cake(x),y_correct))

Undefined function 'birthday_cake' for input arguments of type 'double'. Error in Test4 (line 2) assert(isequal(birthday_cake(x),y_correct))

5   Fail
x = 12;y_correct = 4; assert(isequal(birthday_cake(x),y_correct))

Undefined function 'birthday_cake' for input arguments of type 'double'. Error in Test5 (line 2) assert(isequal(birthday_cake(x),y_correct))

6   Fail
x = 27;y_correct = 6; assert(isequal(birthday_cake(x),y_correct))

Undefined function 'birthday_cake' for input arguments of type 'double'. Error in Test6 (line 2) assert(isequal(birthday_cake(x),y_correct))

7   Fail
x = 127;y_correct = 9; assert(isequal(birthday_cake(x),y_correct))

Undefined function 'birthday_cake' for input arguments of type 'double'. Error in Test7 (line 2) assert(isequal(birthday_cake(x),y_correct))

8   Fail
x = 2015;y_correct = 23; assert(isequal(birthday_cake(x),y_correct))

Undefined function 'birthday_cake' for input arguments of type 'double'. Error in Test8 (line 2) assert(isequal(birthday_cake(x),y_correct))

9   Fail
x = 4060225;y_correct = 290; assert(isequal(birthday_cake(x),y_correct))

Undefined function 'birthday_cake' for input arguments of type 'double'. Error in Test9 (line 2) assert(isequal(birthday_cake(x),y_correct))

10   Fail
x = 1234567890;y_correct = 1950; assert(isequal(birthday_cake(x),y_correct))

Undefined function 'birthday_cake' for input arguments of type 'double'. Error in Test10 (line 2) assert(isequal(birthday_cake(x),y_correct))

11   Fail
x = 1362067890;y_correct = 2015; assert(isequal(birthday_cake(x),y_correct))

Undefined function 'birthday_cake' for input arguments of type 'double'. Error in Test11 (line 2) assert(isequal(birthday_cake(x),y_correct))

12   Fail
y=arrayfun(@(x) birthday_cake(x),1:1000); assert(isequal(sum(y),13965)) [x1,y1]=hist(y,unique(y)); [m1,m2]=max(x1); assert(isequal(m1,154)) assert(isequal(x1(isprime(x1)),[2 7 11 29 37 67 79 137]))

Undefined function 'birthday_cake' for input arguments of type 'double'. Error in Test12>@(x)birthday_cake(x) (line 1) y=arrayfun(@(x) birthday_cake(x),1:1000); Error in Test12 (line 1) y=arrayfun(@(x) birthday_cake(x),1:1000);

### Community Treasure Hunt

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

Start Hunting!