Why am I getting this output? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
3 Answers
+ 1
to be shure: an input of "1 abc" should output "bcd". Right ?
21st Aug 2019, 3:20 PM
Michael F
Michael F - avatar
0
Code 1 line 18: i=0 19: j++ 20: str[j] 20: alph[i] 21: alph[i+num] And you should handle the case that i+num can be > alph.lenght. Also right now the performance is really bad. You should rethink your algorithm.
22nd Aug 2019, 4:41 AM
Michael F
Michael F - avatar
0
You have a point, but now? https://code.sololearn.com/cu7W7CnJaSEy/?ref=app Why the following code doesn't work? if(i+num>26){ code[j] = alph[(i+num)-26]; }
28th Aug 2019, 12:51 PM
Emir Dalfidan
Emir Dalfidan - avatar