Mobile Challenge | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Mobile Challenge

There is a mobile challenge in Ruby for pig-latin. I have built the code in the playground and solved the problem, however, the mobile site wont accept my code as the correct answer. Any help would be appreciated, thanks! https://code.sololearn.com/cJ8A2SaZWy1J/?ref=app

25th Apr 2020, 5:29 AM
Jordan Howlett
Jordan Howlett - avatar
2 Answers
+ 2
Maybe there is something wrong in your logic. Can you share your code so that we can check.
25th Apr 2020, 5:31 AM
A͢J
A͢J - avatar
+ 1
It looks like your solution works fine. It also looks like you may be over complicating it. You can achieve this challenge in just a few lines of code. Your input is fine. Then just use a variable to hold the output string. try using a for-in loop instead of 2 while loops. inside the loop use slicing to create the word in piglatin and append it to the output string print the output string (Hint use .rstrip to remove trailing whitespace)
25th Apr 2020, 7:51 AM
ChaoticDawg
ChaoticDawg - avatar