Cody

Solution 2211521

Submitted on 14 Apr 2020 by Binbin Qi
  • Size: 39
  • 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.

Test Suite

Test Status Code Input and Output
1   Pass
p=[ 10, 4, 1, 2, 5, 2]; t=[ 2, 4, 3, 8, 1, 10]; assert(isequal(greedy_3(p,t,100),515))

2   Pass
p=[4,2,1, 5, 3, 2, 6]; t=[1,8,2, 3, 1, 4, 2]; assert(isequal(greedy_3(p,t,10),-16))

3   Pass
p=[9,10,2,10,7,1,3,6,10,10,2,10]; t=[48 25 41 8 22 46 40 48 33 2 43 47]; assert(isequal(greedy_3(p,t,200),-4008))

4   Pass
p=[1,3,1,2,4]; t=[1,4,10,2,5]; assert(isequal(greedy_3(p,t,200),950))

Suggested Problems

More from this Author145