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.
For anyone wondering, it's the quicksort algorithm. Thanks, this reminded me that it's easy enough to implement. :)
Please add the following to
InvalidCoordinates
:"91.53525235,189.45235"
I had a mistake which allowed longitude to go up to
189.xxxx
and no test case broke.This comment is hidden because it contains spoiler information about the solution
Ran into a random test case where the recipe required
{'cocoa':0,...}
and the expected result was then 0 (should be 31 if you ignored the cocoa).I think
recipe[i] = Test.randomNumber();
causes the problem. I guessTest.randomNumber()
can return 0.IMO the right mindset is to solve problems as efficiently as possible. If the author wants to force us to use recursion, let them come up with a problem that absolutely requires recursion.
Also, as far as I know, JavaScript doesn't do tail-call optimization, so recursion can run into the recursion-depth limit fairly quickly. With that in mind, I'd solve most recursion problems using loops anyway.
The 1st sample test case says
2048-07-01
should returnTrue
, but the closest date range is2048-07-18 - 2048-10-25
.According to my calculations
2048-07-01
is 40483 days away from1937-8-30
.Fun problem but I found the description a bit hard to understand.
Parts that confused me and suggestions:
How come the group passes multiple times?
Consider rephrasing this part as:
Parts of the description refer to "float(s)" of a group. I found this confusing. Consider calling them "parts".
So, we're busy and don't want to watch the full parade; we come and go so that we only watch our favorite group. But why do we always return to the same location and not move across the parade? At first read I got the impression that we'll move to different locations.
Consider phrasing this as: