Pregunta de entrevista de Infosys

Leetcode DSA question as it is