Pergunta de entrevista da empresa IBM

DSA Question based on two pointer