Cody

# Problem 44718. Optimize the Tollbooths

Solution 2872148

Submitted on 23 Aug 2020 by Alfonso Nieto-Castanon
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
option=[1 0; 0 1; 1 1]; budget=[10;10;10]; y_correct=[10,10]; assert(isequal(toll_pricing_strategy(option,budget),y_correct))

2   Pass
option = [1 0 0; 0 1 0; 1 1 1]; budget=[10;10;15]; y_correct=[10,5,0]; assert(isequal(toll_pricing_strategy(option,budget),y_correct))

3   Pass
option=[0 1 1 0;1 1 1 0;1 0 0 0; 0 0 1 1]; budget=[15 ;25 ;15; 20]; y_correct=[10,0,15,5]; assert(isequal(toll_pricing_strategy(option,budget),y_correct))

4   Pass
option=[0 0 0 1 1 1 0 0 1 1 1 1 1 1 0 0 0 0 0 1 1 1 0 0 1 1 1 1 1 1 0 1 1 1 1 1]; budget=[ 42 ;31 ;12 ;63 ;105 ;87]; y_correct=[18,12,20,31,11,13]; assert(isequal(toll_pricing_strategy(option,budget),y_correct))

5   Pass
option=[1 1 1 1 1 0 0 0 0 0 0 1 1 1 1 0 1 1 1 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 1 1 1 1 1 0 0 1 1 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1]; budget=[25;50;60;120;40;80;20;60]; y_correct=[30,10,20,5,15,30,10,0]; assert(isequal(toll_pricing_strategy(option,budget),y_correct))

### Community Treasure Hunt

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

Start Hunting!