Flipkart Interview Question

Sliding window technique.