https://medium.com/@monocosmo77/working-with-sliding-window-algorithms-part3-computer-science-bb61079478b6