FICO Interview Question

Asked coding question related to sliding window concept