https://medium.com/@monocosmo77/working-with-sliding-window-algorithms-part1-computer-science-717fb8c59b73