Cody

Solution 2645666

Submitted on 2 Jul 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
a = 4; b = 5; y_correct = 49380; assert(isequal(pattern_sum(a,b),y_correct))

Assertion failed.

2   Fail
a = 7; b = 4; y_correct = 8638; assert(isequal(pattern_sum(a,b),y_correct))

Assertion failed.

3   Fail
a = 5; b = 3; y_correct = 615; assert(isequal(pattern_sum(a,b),y_correct))

Assertion failed.

4   Pass
a = 1; b = 1; y_correct = 1; assert(isequal(pattern_sum(a,b),y_correct))

5   Fail
a = 2; b = 2; y_correct = 24; assert(isequal(pattern_sum(a,b),y_correct))

Assertion failed.

6   Fail
a = 9; b = 9; y_correct = 1111111101; assert(isequal(pattern_sum(a,b),y_correct))

Assertion failed.

7   Fail
a = 0; b = 0; y_correct = 0; assert(isequal(pattern_sum(a,b),y_correct))

Out of memory. The likely cause is an infinite recursion within the program. Error in pattern_sum (line 5) y = (a^b)+pattern_sum(a,b-1);

8   Fail
a = 3; b = 8; y_correct = 37037034; assert(isequal(pattern_sum(a,b),y_correct))

Assertion failed.

Suggested Problems