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
Changed
You can't refactor it if you can't solve it badly.
This comment is hidden because it contains spoiler information about the solution
This was fun, thank you!
Pretty challenging kata of the series, nice one.
You will get the same final answer regardless of which i and j you choose for each iteration, so long as
X[i] > X[j].Thanks! I like to write in functional style when possible and
nextin Python is very useful for that. However, after 2 years it took me a moment to understand what thataccumulatedoes.Agreed on moving the 4 into
cycle, it saves a lot of multiplications (thoughswas meant to represent the sign, expressed with +1 or -1).I prefer to use
math.iscloseinstead ofabsto check if the floating point numbers are close because I can quickly recognize what that code is doing, but your mileage may vary.and you neither have to sort the arrays but fill the appropriate count of values instead. But I guess than it becomes more verbous (not an expert on Python's syntactic sugar)
My solution in Python reaches the "rectangles have only common faces (version 2)" random test then times out. Ported to Javascript, it passes in approx. 9 seconds.
Nice kata despite the clunky description. I did not even try to brute-force the solution because I thought it would time out (my bad). I ended up writing a solution that works for more general cases.
This was fun, thank you! I am particularly happy with the way I achieved numerical stability in Python.
That's clever! It confirms that 55-character limit and return type integer could both be enforced.
There is room to cast it to integers.
This comment is hidden because it contains spoiler information about the solution
Loading more items...