1 test case is showing wrong answer
And in two test cases run error is also there.
Hello @ankitdelhi20,
-
The size of char array is small as per the requirement:
Constraints:
A string of length between 1 to 1000 -
You are not handling the indexes properly
-
The last element of the char-array is null character i.e. ‘\0’.
So, you have to shift that also towards the left. -
The base condition
I have modified your code:
Hope, this would help.
Give a like, if you are satisfied.
Thanks! It worked…
Anytime.
Please, mark this doubt as resolved.
BTW, i won’t mind a like,
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.