Pregunta de entrevista de Flipkart

Coding round question was based on greedy algorithms