Cody

# Problem 45385. Coin distribution

Solution 2192120

Submitted on 4 Apr 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
y=[2000 100 1 2] assert(isequal(coin(2200),y))

y = 2000 100 1 2 ans = 4 6 10 12 14 16 18 20

Assertion failed.

2   Fail
y=[100,20,2;2,1,1] assert(isequal(coin(222),y))

y = 100 20 2 2 1 1 ans = 2 4 6 10 14 16 20

Assertion failed.

3   Fail
y=[2000 500 100 50 20 10 5 2 1 3 1 2 1 1 1 1 1 1] assert(isequal( coin(6788),y))

y = 2000 500 100 50 20 10 5 2 1 3 1 2 1 1 1 1 1 1 ans = 4

Assertion failed.

4   Fail
y=[2000 100 20 5 2 1 56728 3 2 1 1 1] assert(isequal( coin(113456348),y))

y = 2000 100 20 5 2 1 56728 3 2 1 1 1 ans = 4 6 10 14

Assertion failed.

5   Fail
y=[2;2] assert(isequal( coin(4),y))

y = 2 2 ans = 2 4 6 8 10 12 14 16 20

Assertion failed.

6   Fail
y=[1000 100 20 5 2 1 4 2 1 2] assert(isequal( coin(1449),y))

y = 1000 100 20 5 2 1 4 2 1 2 ans = 2 6 10 14 20

Assertion failed.

### Community Treasure Hunt

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

Start Hunting!