Pergunta de entrevista da empresa FactSet

Some two-pointer substring problem on Hackerrank