+ 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 😊😊😊😊😊
20 Answers
+ 9
Java oneliner (ignoring the rules, sorry) :
https://code.sololearn.com/clpDKml5XO5I/?ref=app
+ 14
like this??
https://code.sololearn.com/ccveY6sFL2Pq/?ref=app
+ 13
Here's, without sort(), reverse(), loops...
https://code.sololearn.com/cWO7gkLoQfr0/?ref=app
+ 11
@Soufyane
Sorry, I totally predicted that part of the task 🤓
I'll scramble to post new code as soon as I find time 😉
+ 6
@Soufyane
1. sort after reverse
2. only alphabets
+ 5
No
😊
+ 4
@pegasus the inputs can be of your choice.
+ 3
@Swadhin please sort by second character.
+ 3
I spent the most time writing the instructions of what the code does xD
https://code.sololearn.com/crY5EPHxR0gy/?ref=app
+ 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
+ 2
number of strings is limited? 2?
+ 2
look at this :
https://code.sololearn.com/c96QWrWJK1nq/?ref=app
+ 2
@LukArToDo you don't meet Rule1: You cannot use any methods like sort(), reverse() etc.
+ 2
@Soufyane Sort added . Thank you
https://code.sololearn.com/c7B6V6WA7W6w/?ref=app
+ 2
@Soufyane
Yeah, I was trying to that but I just got out of the bus, so maybe for another day =D
+ 1
How many inputs are provided? A lot?
+ 1
sort by second letter before or after reverse?
does it accept any characters or only alphabetic?
+ 1
@Lucas
Bonus: Try not to use loops