Atlassian | OA | max number of customer satisfied
Anonymous User
366

You are given a list of customers and a list of shops. Each customer has a list of items of fixed size n and each shop has a list of items of fixed size m. A maximum of 2 shops can be open at any time. If all of a customer's items can be purchased at the open shops, the customer is satisfied. Return the maximum number of customers that can be satisfied.

Example: customers = [ [1,2], [1,5] ]; shops = [ [1,3,4,5], [2,4,6,8], [1,3,4,6] ]; solution(customers, shops) = 2 because we can open shop 1 and shop 2 to satisfy all customers.

I cannot think of an efficient algorithm for this problem.

Comments (2)