Pregunta de entrevista de IBM

DSA Question based on two pointer