Pergunta de entrevista da empresa Infosys

Leetcode DSA question as it is