Pregunta de entrevista de Amazon

Solve this leetcode medium problem involving rolling windows on a string.