Given a string representing an alien message, encode it by shifting all vowels to the next vowel in the sequence 'aeiou' (with 'u' wrapping around to 'a') and leave consonants unchanged, then reverse the entire string to decipher the message.
Explanation: Step-by-step: 1. 'h' is a consonant, so it remains unchanged: h 2. 'e' is shifted to 'i': i 3. 'l' is a consonant, so it remains unchanged: l 4. 'l' is a consonant, so it remains unchanged: l 5. 'o' is shifted to 'u': u 6. 'u' wraps around to 'a': a 7. 'a' is shifted to 'e': e 8. 'e' is shifted to 'i': i 9. 'e' is shifted to 'i': i 10. The entire string is reversed to get the output 'iolmuuiae'.
Explanation: Step-by-step: 1. 'o' is shifted to 'u': u 2. 'u' wraps around to 'a': a 3. 'r' is a consonant, so it remains unchanged: r 4. 'a' is shifted to 'e': e 5. 'j' is a consonant, so it remains unchanged: j 6. 'n' is a consonant, so it remains unchanged: n 7. 'a' is shifted to 'e': e 8. 'm' is a consonant, so it remains unchanged: m 9. 'i' is shifted to 'a': a 10. 'l' is a consonant, so it remains unchanged: l 11. 'a' is shifted to 'e': e 12. 'k' is a consonant, so it remains unchanged: k 13. The entire string is reversed to get the output 'uueaenilak'.
Master coding challenges related to Strings and solve the [Backup] Galactic Translator problem optimally.
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak