Cody

# Problem 45422. Coin Distribution - 02

Solution 2192062

Submitted on 4 Apr 2020 by Nikolaos Nikolaou
• Size: 66
• This is the leading solution.
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
coins= [ 2,3,5]; amount = 10; assert(isequal(coin_lev(coins,amount),4))

out = 4

2   Pass
coins= [2,3,5,10]; amount = 15; assert(isequal(coin_lev(coins,amount),9))

out = 9

3   Pass
coins= [ 2,3,5]; amount = 50; assert(isequal(coin_lev(coins,amount),51))

out = 51

4   Pass
coins= [2,5,10,1,20]; amount = 1225; assert(isequal(coin_lev(coins,amount),49884828))

out = 49884828

5   Pass
coins= [ 11,19,23]; amount = 12252; assert(isequal(coin_lev(coins,amount),15681))

out = 15681

6   Pass
coins= [ 11,19,23,100]; amount = 50; assert(isequal(coin_lev(coins,amount),0))

out = 0

7   Pass
coins= [1,2,3,4,5,8,10,15,20,25]; amount = 200; assert(isequal(coin_lev(coins,amount),119495730))

out = 119495730

### Community Treasure Hunt

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

Start Hunting!