HashedIn by Deloitte interview question

Related to sliding window algorithm