Cody

Problem 45422. Coin Distribution - 02

Solution 2192666

Submitted on 4 Apr 2020 by William
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))

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

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

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

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

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

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

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!