+ 9

⚡⚡Challenge🔥🔥 😋😋

Create a challenge that challenges others to create a challenge.... just kidding Challenge: To reverse the given strings and rearranging them alphabetically based on the second character. Example: "hello", "bye" => "olleh", "eyb" 2. "aye", "hey" => "yeh", "eya" Rules: 1. You cannot use any methods like sort(), reverse() etc. 2. You need to write comments in your code, describing what each line does. Bonus: Try not to use loops. Hint: Recursion All languages are welcome GoodLuck 😊😊😊😊😊

2nd Dec 2017, 11:24 AM
Cool Codin
Cool Codin - avatar
20 Answers
+ 9
Java oneliner (ignoring the rules, sorry) : https://code.sololearn.com/clpDKml5XO5I/?ref=app
3rd Dec 2017, 4:24 PM
LukArToDo
LukArToDo - avatar
3rd Dec 2017, 7:11 PM
Justine Ogaraku
Justine Ogaraku - avatar
+ 13
Here's, without sort(), reverse(), loops... https://code.sololearn.com/cWO7gkLoQfr0/?ref=app
3rd Dec 2017, 6:29 PM
LukArToDo
LukArToDo - avatar
+ 11
@Soufyane Sorry, I totally predicted that part of the task 🤓 I'll scramble to post new code as soon as I find time 😉
3rd Dec 2017, 4:31 PM
LukArToDo
LukArToDo - avatar
+ 6
@Soufyane 1. sort after reverse 2. only alphabets
2nd Dec 2017, 5:32 PM
Cool Codin
Cool Codin - avatar
+ 5
No 😊
2nd Dec 2017, 11:33 AM
Cool Codin
Cool Codin - avatar
+ 4
@pegasus the inputs can be of your choice.
2nd Dec 2017, 5:31 PM
Cool Codin
Cool Codin - avatar
+ 3
@Swadhin please sort by second character.
3rd Dec 2017, 4:49 PM
Soufyane Bouchaala
Soufyane Bouchaala - avatar
+ 3
I spent the most time writing the instructions of what the code does xD https://code.sololearn.com/crY5EPHxR0gy/?ref=app
3rd Dec 2017, 5:57 PM
Lucas Pardo
Lucas Pardo - avatar
+ 3
It's not the prettiest Code I have written and in fact, not a very good use of recursion (I am really bad at recursion), but...Oh, Well, at least It works xD https://code.sololearn.com/cnr0iFO1ZRo2/?ref=app
5th Dec 2017, 3:44 PM
Lucas Pardo
Lucas Pardo - avatar
+ 2
number of strings is limited? 2?
2nd Dec 2017, 11:32 AM
Soufyane Bouchaala
Soufyane Bouchaala - avatar
2nd Dec 2017, 2:16 PM
Soufyane Bouchaala
Soufyane Bouchaala - avatar
+ 2
@LukArToDo you don't meet Rule1: You cannot use any methods like sort(), reverse() etc.
3rd Dec 2017, 4:27 PM
Soufyane Bouchaala
Soufyane Bouchaala - avatar
+ 2
@Soufyane Sort added . Thank you https://code.sololearn.com/c7B6V6WA7W6w/?ref=app
3rd Dec 2017, 4:46 PM
Swadhin Sangram Swain
Swadhin Sangram Swain - avatar
+ 2
@Soufyane Yeah, I was trying to that but I just got out of the bus, so maybe for another day =D
3rd Dec 2017, 6:28 PM
Lucas Pardo
Lucas Pardo - avatar
+ 1
How many inputs are provided? A lot?
2nd Dec 2017, 12:51 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 1
sort by second letter before or after reverse? does it accept any characters or only alphabetic?
2nd Dec 2017, 1:32 PM
Soufyane Bouchaala
Soufyane Bouchaala - avatar
+ 1
@Lucas Bonus: Try not to use loops
3rd Dec 2017, 6:24 PM
Soufyane Bouchaala
Soufyane Bouchaala - avatar