Problem String window

sample test case clear but all other test case fail.
help me to fixed .

process is wrong i am providing a simple tc where code fails

1st string = abbbbbabc
2nd string = abc
your output = abbbbabc
please try again

now it work for only two test case

after making following correction

if(ans.size() < temp.size())
temp = ans;

anything wrong plz figure out.

hello raju sory for the delay… once you got all the characters of s2 in s1 let that substring be temp now you should remove extra character starting from left which are redundant in string temp

Store the occurrence of characters of given pattern in a hash_pat[].
Start matching the characters of pattern with the characters of string i.e. increment count if a character matches
Check if (count == length of pattern ) this means a window is found
If such window found, try to minimize it by removing extra characters from beginning of current window.
Update min_length
Print the minimum length window.

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.