+ 8
💻CHALLENGE: Sort the lettres of a string alphabetically🔤
Challenge: Split a string in chunks containing same characters. These chunks must be organized alphabetically. Example: "aaabcdbdbeffcf" -> ["aaa", "bbb", "cc", "dd", "e", "fff"] Happy coding🙂
10 Respuestas
+ 11
Still needs some formatting...
https://code.sololearn.com/cspu9P2yXSsF/?ref=app
+ 9
Here's my C# implementation! ✌
LINQ One-Liner〰
str
.OrderBy(c => c)
.GroupBy(c => c)
.Select(g => string.Concat(g.ToList()))
This is relatively easy in C# compared to the recent similar challenge. Enjoy~ ❤
P/S: Duplicate found @ https://www.sololearn.com/Discuss/746250/?ref=app
https://code.sololearn.com/cnp3Ko6ssHzM/?ref=app
+ 9
https://code.sololearn.com/cJB1BRIuW5BB/#java
+ 6
My try, this challenge similar to cut a string challenge, I just modified that code a bit, a bit rough though
https://code.sololearn.com/cWzRvm0P3TRm/?ref=app
+ 3
my practice on python https://code.sololearn.com/c2ouA8zvlgUR/#py
I've applied the method of my https://code.sololearn.com/cJebB2CPkmEI/?ref=app
and this without module: https://code.sololearn.com/cc4N1dnR1UuF/?ref=app
from: https://www.sololearn.com/Discuss/746250/?ref=app
+ 3
+ 2
code in java
https://code.sololearn.com/c31M8B27O7cJ/?ref=app
+ 1
I used Hash for grouping letters, and then sorted the list.
https://code.sololearn.com/cmE1BCKl7VN0/?ref=app