Cody

Problem 42996. what can you get for exactly amount of money

Solution 1929819

Submitted on 10 Sep 2019 by Sam McPheeters
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
s = [ 195 125 260 440 395 290]; n=570; y_correct = [125 125 125 195]; assert(isequal(buy(s,n),y_correct))

row = 101 107 182 1162 2501 2507 2582 2686 2692 2701 2737 3097 3177 7637 8592 8672 y = 125 125 125 195 y = 125 125 125 195

2   Pass
s = [ 150 180 60 40]; n=210; y_correct = [60 150]; assert(isequal(buy(s,n),y_correct))

row = 2 6 15 24 y = 60 150 y = 60 150

Suggested Problems

More from this Author12

Community Treasure Hunt

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

Start Hunting!