Whatfix Interview Question

Optimization problem