Testcases 3 and 8 not passing

code: https://ide.codingblocks.com/s/209371

@myself.yash.srivastav please explain what approach you are trying to use

Sliding window approach. Checking if the current window is having all the characters of pattern given. And shrinking if there is extra quantity of required characters or the quantity of not required character is present in the window

so here you are trying to use count variable as a measure for checking if the current windows matches with the pattern or not.
And your condition for count++ is :- if(freq_s[s[i]]<=freq_pat[s[i]] && freq_pat[s[i]]>0)
but the problem if a char which is present in both strings, pattern and s, then it will not do count++ for a char whose count in s is more that in pattern.
for eg:- s=“paammpp” , pattern=“ppm”

I suggest you to watch the video :- Interview Problem - Maximum Length Unique Character Substring Sliding Window