Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
It's worth noting that you discard the candidates with the least number of votes including no votes during each round. If you get the error above, it's reasonably likely that you discarded the person who was voted for in the first round with the least number of votes, ignoring that some candidates were not voted for, and thus, had fewer votes.
Nice -- jsperf.com is handy. I added a couple more tests just to see, and it looks like the simple regexp one is probably the way to go -- legible and fast.
"... now they have two problems."
Bizarre, but fun. I wouldn't go this way for maintainability/legibility reasons, but it's cool anyhow.
I wish CodeWars would also run a larger set of test cases and give you some performance characteristics, I'd be curious to see how this performs against a simpler regexp solution.
This comment is hidden because it contains spoiler information about the solution
The two parameters are Date objects, which include times.
True enough. My coffeescript still has remnants of Javascript in it.
Somehow this solution feels more 'functional' to me, although the iterative approach taken by almost all the other solutions is perhaps more logical.
Would be nice if the question were clear as to whether or not the returned value should be an integer or floating point. (That is, if 4.123 seconds have elapsed, what should the function return?)
This comment is hidden because it contains spoiler information about the solution
This is so easy that it seems unworthy of a kata, no?
This is solid code, but doesn't seem like idomatic coffeescript to me. More imperative than functional in style.