BuyHatke Hiring Challenge problem. How to approach?

please check out this: algorithm - How to find the biggest subset of an array given some constraints? - Stack Overflow