can you help me with extra-terrestials exercise from code coach? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 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 Antworten
+ 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