FICO interview question

Asked coding question related to sliding window concept