Swiggy SDE 2 online assessment | Hackerrank
Anonymous User
16485

Given 3 arrays called as pickup, drop and tip. find the max profit the delivery guy can earn.
The guy can only process one delivery at a time.
e.g he gets profit of 5 - 0 + 1 = 6
6 units if delivers the 1st order

pickup: [0,2,9,10,11,12]
drop:[5,9,11,11,14,17]
tip:[1,2,3,2,2,1]

this seems to be a variation of greedy algorithm's activity selection problem.

Comments (11)