My code is giving wrong answer pls look into it
Problem with my code
you can check this out once, for the code and approach, this one will pass
if(cnt==sizep)
{
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;
}
}
problem is in this loop
fixed here
also try and run it on leetcode for test cases