Story
The Pied Piper has been enlisted to play his magical tune and coax all the rats out of town.
But some of the rats are deaf and are going th...
For further actions, you may consider blocking this person and/or reporting abuse
Thanks for the feedback. With a little inspiration from Avalander's Scala solution, I've got it what I had in mind in the first place.
Nice math trick with the piper, hadn't thought of that!
Done very quickly, but works.
F#
Slightly over-engineered solution in Scala.
And the tests:
Using javascript
CodeSandbox example
Using Ruby and Regex
Output:
Here is my javascript walkthrough, I've used repl.it for the first time and it felt like a great use case.
Let me know if the video helps you!
JS