Added sample tests and updated description.
I don't see what's the point of that statement: if you're running JS code it's run either from Node or from a browser, and both have their own exclusive stuff (browser has btoa and the likes).
Why check 100 random letters? Why not just check all lowercase and all uppercase letters?
Fixed, and cleaned up the description a bit.
Agreed, way harder than 7. I expect they thought (as I did on first read) that the challenge was simply to return the number of months that start on Friday in a range of years.
This sentence If multiple golds are found in one piece of soil they should be added together, so that the following piece of soil "g5 g5; sdg g44" has two pieces of soil, both containing gold, with respective values of 10 and 44. doesn't seem to be used for anything in the actual tests.
If multiple golds are found in one piece of soil they should be added together, so that the following piece of soil "g5 g5; sdg g44" has two pieces of soil, both containing gold, with respective values of 10 and 44.
It's the ending of the first that has to fit with the beginning of the next.
Thus, in your example, we would get don between abanDON and DONation. Then we would get on between donatiON and ONion. Lastly, we would get on between oniON and ONgoing.
This gives us dononon in total.
Please provide the same input and output, as produced.
Damn, I thought I had a nice solution.
I too get the error with join, without using join at all, but it passes in Node v6.11.0.
Well, reading a bit around, it looks like that Ruby's sort is not stable (unlike Python), but it seems to work here...
One would think that just sorting it wouldn't work, since multiple entries would all get 0 as a value. If sort_by was implemented differently in Ruby, you could get other (incorrect) results.
I agree. The person that approved this Kata has not yet attempted it. I've been waiting to see his solution.
I wonder why Codewars allows this. Personally, I only approve Katas that I have attempted.