Salesforce interview question

Variable window sliding window based problem