Domanda di colloquio di Amazon

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