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.
Friendship is commutative. (The description doesn't explicitly say this, but I think it's clear from the example given, which has
Harry/Ron
but notRon/Harry
.)Can you post the test case (the first few lines of it, at least) that produced the strange behaviour?
That's true, but there is no better way to do it, short of resorting to a higher-precision floating-point type.
You are taking a suboptimal path around the circle with centre at (2.83323324984,-1.17841666332). The path above and to the right of this circle is shorter.
If you think you need inline assembly for this kata, you are probably using an inefficient method. Micro-optimizing a bad algorithm is usually not worth it; try coming up with a better one instead.
It'll feel good when you beat it though. :)
Someone should rewrite the description of this kata. I see many complaints below pointing out that the algorithm is incompletely specified.
This is what the description should have said:
Fixed - a more detailed description of the input is now included.
That's intentional. For this kata, you have to write an entire class from scratch.
Here's the relevant part of the input again. Cells X and Y both have colour 5.
Cell Y has depth 3, but the depth of cell X is only 2 (one step down and one step left get you to a differently-coloured cell). So, X isn't part of the solution.
By "completely trivial" do you mean that the constructors are unnecessary? If so, then yes: they won't be used in most solutions.
The Wikipedia article on OCR-A is fairly detailed. If you want the TrueType font file, it can be downloaded for free from fontzone.com.
The kata doesn't have a built-in way to visualize the images. The idea is that you should code your own visualization; consider it part of the challenge.
Fixed now. Thanks.
Do you still have the solution point you found for this test case? Please post it here if so (3 coordinates, each printed out to 20 decimal places).
My apologies for not responding at the time; sometimes life has to take precedence over Codewars.
Thanks for doing this.
Loading more items...