Domanda di colloquio di Adobe

Dsa question was from Sliding window and two pointers, it was a medium level question.