Flipkart Interview Question

2 Coding questions - sliding window, trees