Cody

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

Solution 3188511

Submitted on 13 Oct 2020
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))

Error in solution: Line: 2 Column: 15 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

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

Error in solution: Line: 2 Column: 15 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

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

Error in solution: Line: 2 Column: 15 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

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

Error in solution: Line: 2 Column: 15 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

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

Error in solution: Line: 2 Column: 15 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

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

Error in solution: Line: 2 Column: 15 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

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

Error in solution: Line: 2 Column: 15 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

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

Error in solution: Line: 2 Column: 15 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

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

Error in solution: Line: 2 Column: 15 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

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

Error in solution: Line: 2 Column: 15 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

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

Error in solution: Line: 2 Column: 15 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

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]))

Error in solution: Line: 2 Column: 15 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

### Community Treasure Hunt

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

Start Hunting!