Cody

Problem 1240. Coin change combinations.

Solution 3068545

Submitted on 5 Oct 2020 by Alex
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
x = 28; y_correct = 13; assert(isequal(change(x),y_correct));

c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 1 c = 5 c = 1 c = 6 c = 6 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 10 c = 1 c = 1 c = 1 c = 2 c = 12 c = 12 c = 1 c = 1 c = 1 c = 13 c = 13 c = 13 c = 13

2   Pass
x = 62; y_correct = 77; assert(isequal(change(x),y_correct));

c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 1 c = 5 c = 1 c = 6 c = 1 c = 7 c = 1 c = 8 c = 1 c = 9 c = 1 c = 10 c = 1 c = 11 c = 1 c = 12 c = 1 c = 13 c = 13 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 1 c = 5 c = 1 c = 6 c = 1 c = 7 c = 1 c = 8 c = 1 c = 9 c = 1 c = 10 c = 1 c = 11 c = 24 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 1 c = 5 c = 1 c = 6 c = 1 c = 7 c = 1 c = 8 c = 1 c = 9 c = 33 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 1 c = 5 c = 1 c = 6 c = 1 c = 7 c = 40 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 1 c = 5 c = 45 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 48 c = 1 c = 1 c = 49 c = 49 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 1 c = 5 c = 1 c = 6 c = 1 c = 7 c = 1 c = 8 c = 8 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 1 c = 5 c = 1 c = 6 c = 14 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 18 c = 1 c = 1 c = 1 c = 2 c = 20 c = 69 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 3 c = 1 c = 1 c = 4 c = 73 c = 73 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 3 c = 1 c = 1 c = 4 c = 4 c = 77 c = 77 c = 77

3   Pass
x = 2; y_correct = 1; assert(isequal(change(x),y_correct));

c = 1 c = 1 c = 1 c = 1 c = 1 c = 1 c = 1

4   Pass
x = 87; y_correct = 187; assert(isequal(change(x),y_correct));

c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 1 c = 5 c = 1 c = 6 c = 1 c = 7 c = 1 c = 8 c = 1 c = 9 c = 1 c = 10 c = 1 c = 11 c = 1 c = 12 c = 1 c = 13 c = 1 c = 14 c = 1 c = 15 c = 1 c = 16 c = 1 c = 17 c = 1 c = 18 c = 18 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 1 c = 5 c = 1 c = 6 c = 1 c = 7 c = 1 c = 8 c = 1 c = 9 c = 1 c = 10 c = 1 c = 11 c = 1 c = 12 c = 1 c = 13 c = 1 c = 14 c = 1 c = 15 c = 1 c = 16 c = 34 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 1 c = 5 c = 1 c = 6 c = 1 c = 7 c = 1 c = 8 c = 1 c = 9 c = 1 c = 10 c = 1 c = 11 c = 1 c = 12 c = 1 c = 13 c = 1 c = 14 c = 48 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 1 c = 5 c = 1 c = 6 c = 1 c = 7 c = 1 c = 8 c = 1 c = 9 c = 1 c = 10 c = 1 c = 11 c = 1 c = 12 c = 60 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 1 c = 5 c = 1 c = 6 c = 1 c = 7 c = 1 c = 8 c = 1 c = 9 c = 1 c = 10 c = 70 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 1 c = 5 c = 1 c = 6 c = 1 c = 7 c = 1 c = 8 c = 78 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 1 c = 5 c = 1 c = 6 c = 84 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 88 c = 1 c = 1 c = 1 c = 2 c = 90 c = 90 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 1 c = 5 c = 1 c = 6 c = 1 c = 7 c = 1 c = 8 c = 1 c = 9 c = 1 c = 10 c = 1 c = 11 c = 1 c = 12 c = 1 c = 13 c = 13 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 1 c = 5 c = 1 c = 6 c = 1 c = 7 c = 1 c = 8 c = 1 c = 9 c = 1 c = 10 c = 1 c = 11 c = 24 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 1 c = 5 c = 1 c = 6 c = 1 c = 7 c = 1 c = 8 c = 1 c = 9 c = 33 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 1 c = 5 c = 1 c = 6 c = 1 c = 7 c = 40 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 1 c = 5 c = 45 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 48 c = 1 c = 1 c = 49 c = 139 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 1 c = 5 c = 1 c = 6 c = 1 c = 7 c = 1 c = 8 c = 8 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 1 c = 5 c = 1 c = 6 c = 14 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 18 c = 1 c = 1 c = 1 c = 2 c = 20 c = 159 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 3 c = 1 c = 1 c = 4 c = 163 c = 163 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 1 c = 5 c = 1 c = 6 c = 1 c = 7 c = 1 c = 8 c = 8 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 1 c = 5 c = 1 c = 6 c = 14 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 1 c = 4 c = 18 c = 1 c = 1 c = 1 c = 2 c = 20 c = 20 c = 1 c = 1 c = 1 c = 2 c = 1 c = 3 c = 3 c = 1 c = 1 c = 4 c = 24 c = 187 c = 187 c = 187

Suggested Problems

Community Treasure Hunt

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

Start Hunting!