+ 1

Extra-Terrestrials task

Could someone tell me what's wrong in this code or wich is the test case 3? https://code.sololearn.com/cKNf9H99esja/?ref=app

17th Jan 2020, 10:28 PM
David
David - avatar
7 Answers
+ 3
The size. It is not big enough. Try 90 instead of 20.
17th Jan 2020, 10:32 PM
Fernando Pozzetti
Fernando Pozzetti - avatar
+ 1
Thanks!
17th Jan 2020, 10:34 PM
David
David - avatar
+ 1
I have been testing the code and if you write i<length instead of i<=length or i<length+1 sometimes it doesn't work. I don't really know why this happends, but if the word's length is a multiple of 4 a question mark appears at the end
7th Nov 2020, 3:21 PM
David
David - avatar
0
why is there a "+1" in the loop condition?
7th Nov 2020, 1:25 PM
Saurabh Gupta
0
I wrote that code a long time ago so I don't remember it very well. I think it was because since there is a minor instead of an equal or minor, the loop did not reach the last character. Anyway, I should change it a little bit
7th Nov 2020, 1:39 PM
David
David - avatar
0
can you explain it a little more
7th Nov 2020, 2:11 PM
Saurabh Gupta
0
please do post if you find why this happens
7th Nov 2020, 4:54 PM
Saurabh Gupta