Pergunta de entrevista da empresa Infosys

Coding question it was tricky