0
What is the mistake I have done here ,can someone explain please?
Problem in a code ,help. https://code.sololearn.com/c068N3b4t0OR/?ref=app
2 Respuestas
+ 2
Assume the input is "Carrie".
Carrie
012345 - The last index is 5.
But the length of the string is 6. In the first loop it won't found index 6 and cause error. You can do for(i = l-1 ; i>=0 ; i--) to avoid it.
+ 1
Thanks ,got it👍 I m a newbie in java now.