Pregunta de entrevista de FactSet

Some two-pointer substring problem on Hackerrank