What is the error? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the error?

Test solving extra terrestrial https://code.sololearn.com/c4h0qOepLNhj/?ref=app

9th Apr 2020, 4:15 PM
Ivano Marcuz
Ivano Marcuz - avatar
2 Answers
+ 2
Check where you are starting to access the characters. The string range is [0, length - 1], not [0, length].
9th Apr 2020, 4:21 PM
Shadow
Shadow - avatar
0
With y = x.length() -1; It work! Thanks
9th Apr 2020, 4:34 PM
Ivano Marcuz
Ivano Marcuz - avatar