+ 7
[Challenge] Sorting words.
Write a program that accepts a sequence of whitespace separated words. Remove all duplicate words and remove non-letter marks before or after words(not middle). Sort them alphanumerically. Input example: Hello world and practice makes perfect!!! And hello world again. Then, the output should be: again and hello makes perfect practice world Built in sorting functions are not allowed!
9 odpowiedzi
+ 17
Oneliner...
https://code.sololearn.com/c1yjE0xgy42i/?ref=app
+ 3
One line using java
https://code.sololearn.com/cN7ZA2ZtU5z9/?ref=app
+ 3
Fun one! Done in Ruby using a binary search tree, just used a couple builtins to cleanup the input string first.
https://code.sololearn.com/c84D06k6JdCf
Just updated to simplify the code a bit more and add relevant comments
+ 1
Sorry! Built in sorting functions are not allowed!
+ 1
I didn't read that jajaja, I'll try again
0
Fixed! :)