+ 3
Does anyone has the solution to Secret Message problem from the code coach section?
I did find a solution but the 4th test case is giving an error and since that test case is hidden I am unable to pinpoint the real error. Here is the code. https://code.sololearn.com/cnXZEHChdJI6/?ref=app
11 Respuestas
+ 5
Here is a code:
https://code.sololearn.com/cjGMmQQWusF6/?ref=app
Of course I have to say that I don't agree with such an action (copy a code from another) but I can partly understand you.
(Please always try to do things on your own 🙂.)
+ 3
Alexey Rubtsov Your one liner inspired me to try and figure out how to do the same with the Pig Latin challenge. Also only for those who have already solved the challenge.
https://code.sololearn.com/cz8dF9nN8Wl8/?ref=app
Thanks for the inspiration!
+ 2
Thomas, of course I agree with you and I wrote what I think. Also I posted a code which is already public.
+ 2
Here is another solution in one string. Only for those who have already solved.
https://code.sololearn.com/cGqWPwDJL9xJ/?ref=app
+ 1
Elen V not so nice to post a complete solution 😞
0
dolam62331 there goes some thing wrong in your code.
Input: nm becomes the same output: mm
Maybe you should check this
0
I thought of the solution this way:
There are 26 nos. so 26/2 = 13 is the middle position to decide if the given letter has a lesser position than 13 or does it have greater position than 13. If the letter has the position 13 i.e., ascii =109 which is 'm', then i print m directly.
0
But if
n - > m
and
m -> m
it makes no sence
I did it with a dict. This works for all test cases. Have a look
at this
d = {'a':'z', 'b':'y', 'c':'x', 'd':'w', 'e':'v', 'f':'u', 'g':'t', 'h':'s', 'i':'r', 'j':'q', 'k':'p', 'l':'o', 'm':'n', 'n':'m', 'o':'l', 'p':'k', 'q':'j', 'r':'i', 's':'h', 't':'g', 'u':'f', 'v':'e', 'w':'d', 'x':'c', 'y':'b', 'z':'a'}
0
Yes I understood what you are saying. Thanks a lot for helping me.
0
You're welcome
0
dolam62331 here is another solution using map
https://code.sololearn.com/cP349X84gsWA/?ref=app