EY Interview Question

Had a questionr elated to Sliding window