You're saying goodbye to your friend when they say to you, "See you next happy year!" You smile and wave, saying you'll see them then. But wait, wh...
For further actions, you may consider blocking this person and/or reporting abuse
Javascript:
Results:
Clever usage of Set!
Elixir (now with doctests!):
And a test file (just for the sake of completeness):
Using a regex in Perl:
Elm
Tests
Edit
Just realized there is a native Set module in Elm by looking at the comments made in JavaScript which is awesome, but I'll keep this as is for the record. I'm edgy anyway!
Edit2
Turns out, after an interesting talk with the folks at the Elm Slack, and some experimentations, there is no way to to
Set
that keeps the order of theList
due to the Haskell implementation behind, preventing to have an easy solution. So this means either use an extra library (which I tend to avoid since I wanted to show a native Elm solution) or use a combination just like I did!Here is my solution using PHP:
And here is my unit tests:
Hope you like it :)
Rust:
This was a strange exercise to do in Rust. Feels dirty to use conversion to string :(
APL (I'm using Dyalog APL)
Code:
Tests:
Simple JS solution:
And a PHP solution:
quick python solution
My ugly answer. But I thought I would at least give this a go in python.
Great, thanks! I blanked out on this for some reason :)