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
I see it is using a perpetual Gregorian Calendar which makes pattern finding easier.
I'm wondering about year 1000. When I look at this calendar https://www.timeanddate.com/calendar/?year=1000&country=1. It shows March 1000 as having an extended weekend. But in the sample test cases. It has no extended weekends for that year. It looks like the first month is from Aug 1001.Are we assuming perpetual Gregorian Calendar instead of changing to the Julian Calendar when appropriate?
In javascript for input
[ { type: 'red', distance: [ 50, -8 ] },
{ type: 'black', distance: [ 55, -7 ] },
{ type: 'red', distance: [ 82, -8 ] },
{ type: 'black', distance: [ 67, 9 ] },
{ type: 'black', distance: [ 90, -3 ] },
{ type: 'red', distance: [ 75, 2 ] },
{ type: 'jack', distance: [ 81, -5 ] } ]
The expected result is 'red scores 2'.
Accoring to my calculations the distance for the closest black ball and the 2nd closest red ball are identical therefore score should be 1.
Thanks - that was it.
Failing all javascript random tests. All tests expect 0. Example:
Testing for [[500, 189],[753571, 196],[68, 19773],[1159171, 637],[100, 45125]]
Expected 0 got 830610180
product - lcm is zero when there are no common factors
100,45125 have a common factor of 5. Therefore sum should not be zero.
Please explain why this logic is wrong.
22 in the test Series is correct.
Base Series 1,2,4,8.16,22
Test Series 15,20 (first iteration) ,22 (2nd iteration)
Number of iterations in the Test Series to Converge => 2
You only count the number of iterations you need in the Test Series to get to a number in the Base Series.
sorry - yes javascript.
In JavaScript node 8.
I'm having problems with the given bignumber library.
It has no math functions so no way to add, multiply, check for LessThan, etc.
I got the algorithm to work locally reasonably fast. But without math this is hard to solve.
with random tests
test Series starting with 94224
I get expected 861 got undefined -
It confused me that in the random tests the usual expected and got are reversed.
Here expected is the value my function returns and got was what the value the program being used to test returns.
On step 861 I am matching 3110832 with the original series.
Since the testing function is returning undefined I think this is a bug?