Pergunta de entrevista da empresa Navan

Asked to code a simple sliding window problem