Doubt in Sanket and Strings

The code is passing only 1 test case. What’s the error in it?

Hello @namanmanchanda09,

You have not handled the cases properly:
Example:
1
abba
Your Ouptut:
4
Expected Output:
3

I have modified your code:

Hope, this would help.
Give a like if you are satisfied.

1 Like