In this function why all test cases pass when i do right<s.length()-1 and one test case fail if i do right<s.length().
for (right; right < s.length()-1; right++)
{
if (s[right]!=ch)
{
count++;
}
if (count==n)
{
break;
}
}
this is complete code https://ide.codingblocks.com/s/271209