SANKET AND STRINGS : TWO TEST CASES NOT SATISFIED

@mverma_be19
your logic is Not Correct
try for this input :
2
aabbaababba
correct output : 6
your output : 8

if you were to replace 3rd and 4th b with a the string would become aaaaaababba, which would make the longest substring of only a or b to be of size 6.