Two Sigma Interview Question

sliding window array problem, lc medium