can you help me with extra-terrestials exercise from code coach? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

can you help me with extra-terrestials exercise from code coach?

the output looks the same as the required one but it says I didn't paรญses. Basically I have to reverse the word of input, for example if input is "house", the output is "esuoh". I don't know whats the problem with the system. https://code.sololearn.com/cEAo9NFXh8Yu/?ref=app

29th Jul 2022, 3:18 PM
Martin Ledezma
Martin Ledezma - avatar
5 Answers
+ 2
Start loop int i=num-1; Instead of int i=num; Max index is length-1 only..
29th Jul 2022, 3:47 PM
Jayakrishna ๐Ÿ‡ฎ๐Ÿ‡ณ
+ 2
Jayakrishna๐Ÿ‡ฎ๐Ÿ‡ณ thank you, I solved just by adding "-1" to my num
29th Jul 2022, 4:44 PM
Martin Ledezma
Martin Ledezma - avatar
+ 1
You need to reverse every word. And the word order needs to be kept. That is "the house" needs to translate to "eht esuoh". Not "eht" as you have now, nor "esuoh eht". So, you need to put in more work.
29th Jul 2022, 3:46 PM
Ani Jona ๐Ÿ•Š
Ani Jona ๐Ÿ•Š - avatar
+ 1
Ani Jona ๐Ÿ•Š it just asked for one word but what you told me is very useful for future exercises, thanks
29th Jul 2022, 4:44 PM
Martin Ledezma
Martin Ledezma - avatar
+ 1
Oh really? I thought the alien language task was with several words. Oh well, what do you know ... ๐Ÿคทโ€โ™‚๏ธ๐Ÿ™‚
29th Jul 2022, 7:17 PM
Ani Jona ๐Ÿ•Š
Ani Jona ๐Ÿ•Š - avatar