Pergunta de entrevista da empresa Cognitree Technologies

Leet code medium level problem