in the countMaxWindowsSize function why is the part
if(j<s.size()-1 && s[i-1]!=ch)
{
j++;
}
written??
in the countMaxWindowsSize function why is the part
if(j<s.size()-1 && s[i-1]!=ch)
{
j++;
}
written??
@Manvik-Arya-4391661007540658 its written
If the char at previous position of left pointer was not ch, then that position must have counted as a swap earlier. Now we have a free swap available. Iterate right pointer forward to use that one free swap