Cody

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

Solution 1749505

Submitted on 13 Mar 2019 by Martin Vatshelle
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))

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

Suggested Problems

More from this Author12