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 is shit
This was my bad for reading the description poorly. I thought that U U U was identical to U 3 - not the case.
Thanks guys! appreciate it!
Description asks for head position and N: Number of steps leading up to and including the collision
There is a test case with these moves given: U R L D U R L D
The first move leads to a collision against the top border of the board. However the test expects [[0, 2], 0] rather than [[0, 2], 1]
Am I missing something or is this wrong?
This comment is hidden because it contains spoiler information about the solution
In your alternate solution, the 2 square at row index 4, column index 1 is touching 3 mines.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
The description states: The array of pairs must be in ascending order ... In the case of two pairs with the same first color, the 2nd color must be in ascending order.
There are some tested pairs with identical red and green parts and different blue parts. These need to be sorted ascendingly based on blue to pass the tests.
While this is easy to infer, I suggest changing the description
This comment is hidden because it contains spoiler information about the solution
Description really needs to mention that ONLY the Gregorian calendar should be used, and needs to be applied proleptically for earlier years.
Otherwise users who don't want to use datetime libs waste time coding Julian<->Gregorian use cases, e.g. the year 1752.
JS needs random tests ;)
i does not need to iterate over all the whole numbers. 2 is the only even whole number that can be a prime. It's nearly twice as fast to first check if the input is divisible by 2 and is not 2, and then starting i off at 3 and iterating with i += 2.
Also, the loop does not need to go until num/2. Once you get past the square root, there's no point in checking any longer, it has to be prime.
Example runtimes with a large odd number input:
iterating over all integers up to num/2: 0.007080078125ms
interating over odd numbers up to Math.sqrt(num): 0.002685546875ms
Description should be clarified:
Instead of: "Important: All the integers that its reversed has leading zeroes should be discarded: ex: 1890 its reversed is 981 ("0981")"
Better: "Important: Do not include numbers which, when reversed, have a leading zero, e.g.: 1890 reversed is 0981, so 1890 should not be included."
This comment is hidden because it contains spoiler information about the solution
Loading more items...