Amazon Interview Question

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