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.
That's it.
Resolved. Added sample explanation. Also fixed a typo.
Thanks for your contribution!
I agree that it was quite difficult to understand. It only really made sense to me once I looked up chords in circles on wikipedia.
Other that, I like the approach of this kata, to not force me to use a specific algorithm, but instead throw this equation at me and let me decide how I want to solve it.
I think there's no analytical solution, so these are performance tests. I haven't solved it yet thought, so I'm not sure.
The drawing looks correct, the angle in question is AOB, which matches the second sample test. I'm not sure about the proper terms, "cental angle" seems to be more common, but there are many results for "center angle".
Please, explain clearly what you mean by "a chord diving a circle into two parts" and "center angle of the chord". From what I could understand, we have something similar to the plot in the image below where the angle between
AB
andOC
can always be 90 degrees regardless of the1 / X
ratio, and I don't think that is the thing that you're implying.Ah,
X
is not limited to integers, so there's more than 1000 possible inputs. Although, I don't see the point in testing those considering the same formula should work both for integral and non-integralX
.3,000,000 tests for 1,000 inputs? Seriously?
Random tests are not strong enough. This solution should be invalidated.
Sorry, I hardly go to Codewars.
Your solution is incorrect. The numbers are very large and your solution may recurs v*n times. So your program will get a stack overflow.
The time complexity of the solution is O(n log n). Think more!
I get a StackOverflow in the random test.
Fixed. Thanks.
XDDDDDDD
Could you tell, just how fierce the tests for this kata are? :-)
I'm getting constant timeouts with a code, which has O(n) for the number of characters in string.
Loading more items...