Two Sigma interview question

sliding window array problem, lc medium