This solution is outdated. To rescore this solution, sign in.
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))
|
746 Solvers
43 Solvers
Find the maximum two numbers of every column of a matrix
137 Solvers
Numbers spiral diagonals (Part 1)
95 Solvers
22 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!