Sliding Window Technique

Are you also tired of using two for loop or nested loop, so there is a magic technique known as Sliding window technique which reduces your problem in only one for loop and reduce your…