Pregunta de entrevista de Thought Machine

One sliding window and one graph question, medium difficulty