Navan interview question

Asked to code a simple sliding window problem