• ###### ahmet_popajcommented on "Seven-segment display: how many switches?" kata

Pretty challenging kata of the series, nice one.

• ###### HartlIKScommented on "Smallest possible sum " kata

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]`.

• ###### alexc19commented on "alexc19's Python solution for "PI approximation "" kumite

Thanks! I like to write in functional style when possible and `next` in Python is very useful for that. However, after 2 years it took me a moment to understand what that `accumulate` does.

Agreed on moving the 4 into `cycle`, it saves a lot of multiplications (though `s` was meant to represent the sign, expressed with +1 or -1).

I prefer to use `math.isclose` instead of `abs` to check if the floating point numbers are close because I can quickly recognize what that code is doing, but your mileage may vary.

• ###### ka1amitacommented on "Pile of towels" kata

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)

• ###### alexc19commented on "Total area covered by rectangles" kata

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.

• ###### alexc19commented on "How Much?" kata

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.

• ###### alexc19commented on "Linear Equation Solver" kata

This was fun, thank you! I am particularly happy with the way I achieved numerical stability in Python.

• ###### alexc19commented on "One Line Task: Zero Or One" kata

That's clever! It confirms that 55-character limit and return type integer could both be enforced.

• ###### khlivnyukcommented on "One Line Task: Zero Or One" kata

There is room to cast it to integers.

• ###### alexc19created an issue for "One Line Task: Zero Or One" kata

This comment is hidden because it contains spoiler information about the solution

• ###### alexc19commented on "Bridge the Islands" kata

I asked myself the same question, this is not an easy kata to rank. I would say 5-kyu or 4-kyu if the number of islands in the test was choosen so that all brute-force solutions fail, but any "textbook" implementation of the correct algorithm succeeds, regardless of language-dependant optimizations.

If the implementation must be optimized (i.e. choosing the right data structure) in consideration of the high "density" of the bridges, then definitely 4-kyu, but it is not clear to me if that's what you required.

A performance edition could be created (2-kyu maybe) where the number of bridges is so high that some upfront reduction is necessary (see my other comment hidden as spoiler) leveraging the 2D nature of the points representing the islands.

• ###### alexc19commented on "Tracking pawns" python solution

...and that's how you disregard PEP8 with flair ðŸ˜€

• ###### hexoliocommented on "Bridge the Islands" kata

Congrats! And thank you for the kind words.

Yes, I picked the maximum number of islands carefully ðŸ˜ˆ

Out of interest, what kyu rating would you give it?

• ###### alexc19created a suggestion for "Undirected weighted graph" kata

Thanks for this kata. I have a couple of suggestions:

• The description of the kata needs some tidying up. It introduces several definitions that are hard to follow, also due to the flat formatting of the text.
• In the Python initial code it would be helpful to include a "pass" statement as a placeholder in each method. This way, it won't raise any errors, and users can start implementing their solution directly, method by method.
• ###### alexc19commented on "Bridge the Islands" kata

Finally made it, barely beating the clock! Thanks for this super kata.

I tested a few solutions provided by others and they all seem to be in the same order of magnitude as mine. I guess for the 5000 islands case even small optimizations matter.