Pregunta de entrevista de Navan

Asked to code a simple sliding window problem