messed up Google Coding Challenge
Anonymous User
3705

Actually its my first coding challenge from a company but i messed up seriously . It was one hour time for two problems

Problem-1 :
You have a array arr of length n where arr[i] = [cost_i,delivery_i] where cost_i repretsents cost of ith package and delivery_i  represents delivery cost for ith package . we have to send m(<=n) packages . If m(>=1) delivery charge of each item is minimum delivery charge of delivered items.

We need to deliver m packages to the customer that means you need to select m packages from n packages such that total money you obtain by delivering is maximum

Conditions :
1.total cost = sum of costs of each selected package
2.deliery charges = minimum delivery charge in selected m packages * m (bcz delivery charge is applicable for each package)

Constraints
n = len(arr)
0<len(arr)<10**5

Problem-2 :
Return the maximum number of ways we can split an array into two contiguous subarrays such that both subarrays have the same sum and neither is empty after following the given operation
Operation
where we can make atmost one element zero

Constraints
n = len(arr)
0<len(arr)<10**5

Solutions are encouraged

Comments (17)