Cody

Problem 45298. How many ways?

Solution 2123927

Submitted on 10 Feb 2020 by Martin Thomas
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
n = 3; y_correct = 1; assert(isequal( how_many(n),y_correct))

y = 1

2   Pass
n = 4; y_correct = 2; assert(isequal( how_many(n),y_correct))

y = 2

3   Pass
n = 6; y_correct = 14; assert(isequal( how_many(n),y_correct))

y = 14

4   Pass
n = 8; y_correct = 132; assert(isequal( how_many(n),y_correct))

y = 132

5   Pass
n = 9; y_correct = 429; assert(isequal( how_many(n),y_correct))

y = 429

6   Pass
n = 12; y_correct = 16796; assert(isequal( how_many(n),y_correct))

y = 16796

7   Pass
n = 15; y_correct = 742900; assert(isequal( how_many(n),y_correct))

y = 742900

8   Pass
n = 20; y_correct = 477638700; assert(isequal( how_many(n),y_correct))

y = 477638700

Suggested Problems

More from this Author149

Community Treasure Hunt

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

Start Hunting!