Cody

# Problem 45385. Coin distribution

Solution 2192125

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

y = 2000 100 1 2 out = 2000 100 1 2

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

y = 100 20 2 2 1 1 out = 100 20 2 2 1 1

3   Pass
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 out = 2000 500 100 50 20 10 5 2 1 3 1 2 1 1 1 1 1 1

4   Pass
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 out = 2000 100 20 5 2 1 56728 3 2 1 1 1

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

y = 2 2 out = 2 2

6   Pass
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 out = 1000 100 20 5 2 1 4 2 1 2

### Community Treasure Hunt

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

Start Hunting!