https://medium.com/@monocosmo77/working-with-sliding-window-algorithms-part2-computer-science-141593868fac