Whats the error in my code


i have first checked for ‘a’
then for ‘b’

Hello @sktg99,

Let’s consider a testcase:
1.
2
aaaa
Your Output:
5
Expected output:
4

2
abbb
Expected Output:
4
Your Output:
5

Correct it.
You can also refer to the following code for my approach:

Hope, this would help.

I can see some cases are fixed yet and also im not able to correct it completely, pls help me to correct this code,
this question is sanket and strings

i solved it, sorry to bother

No problem.:blush:

You can give a like, if you are satisfied.:wink:

1 Like