Question d’entretien chez Amazon

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