Cody

Solution 1600877

Submitted on 4 Aug 2018 by Aamod Garg
  • Size: 126
  • 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.

This solution is outdated. To rescore this solution, sign in.

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))

Suggested Problems

More from this Author2