FactSet interview question

Some two-pointer substring problem on Hackerrank