Sanket and Strings problem


I’m not sure what the problem with this code is.

@armaanbhardwaj23
for input
2
aabbaababba
your answer is: 8
correct ans will be : 6 for aaaaaababba
correct this

i tried to implement the changes and it works fine but still only the first test case works.

@armaanbhardwaj23
hey its still not working for cases like
3
bababababaaaab
ans:10
you can try and debug your code for this and refer to this

okay.But the question also says that the final answer must remain same in both cases,i.e. if I replace the a’s with b I’m not getting 10 whereas replacing b’s with a I get 10.

@armaanbhardwaj23
No thats not required.You have to print the maximum possible