Pregunta de entrevista de IBM

Slinding window based coding Hacker Rank question