String Window problem

Can you please tell me what is problem with my code

hello @rahul.gupta03111999
pls explain this loop of ur code.

 for(int i=0;i<sl;i++){
	   char ch=s[i];
	   fs[ch]++;
   
  if(fp[ch]!=0 && fs[ch]<=fp[ch]){
	  cnt++;
  }

   if(cnt==pl){
	   char temp=s[start];
	   while(fp[temp]==0 ||fs[temp]>fp[temp]){
		   fs[temp]--;
		   start++;
		   temp=s[start];
	   }

   
   int window_len=i-start+1;
   if(window_len<min_len){
	   min_len=window_len;
	   start_idx=start;
     }

    }

specially the role of cnt

@rahul.gupta03111999

check ur updated code here(comment mentioned)->

It helps me keep a track of the length of the pattern string