String window approach

hi
what is the approach for this problem?

hi @akshitabansal321 use sliding window have u read it?

yes i have done a few questions on it

@akshitabansal321 then think on that line

i tried…but unable to come up with solution… please tell me the algorithm