Flipkart interview question

2 Coding questions - sliding window, trees