String Window -Competitive

Can u please explain the question and how to implement it.

Algorithm
1.First check if the length of string is less than the length of the given pattern, if yes then “no such window can exist “.
2.Store the occurrence of characters of the given pattern in a hash_pat[].
3.Start matching the characters of pattern with the characters of string i.e. increment count if a character matches.
4.Check if (count == length of pattern ) this means a window is found.
5.If such window found, try to minimize it by removing extra characters from the beginning of the current window.
6.Update min_length.
7.Print the minimum length window.

Please have a look at this short snippet for implementation of above algo if you are still unable to understand…

Thanks for ur help
But can u please explain the part of finding window length.

window length that contains what is required.
first find that.
then try to minimize

i mean (int len_window=j-start+1;)
how this came?

Window starting at pos start and ending at j.

Dont go line by line of my code or try to understand carefully. All comments are there, there is nothing difficult in this still you are asking such things
I have told you the algorithm, implement it yourself .

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.