Ad
  • Custom User Avatar

    The operators are already pre-defined.

    I don't think having to write out the numbers from 1 to 10 are too much of an issue. It's more of a suggestion.

  • Custom User Avatar

    You are confusing mod (the % operator) with abs.

    And yes, this kata needs more tests.

  • Custom User Avatar

    While this may be true for some solutions, there is at least one solution that finishes nearly instantly, no matter the input.

  • Default User Avatar

    Hey guys, I'm preparing for interview questions and I'm struggling at kyu 4. How hard the interview questions based on codewar question hardness ranking? Thanks!

  • Default User Avatar

    A couple of people have made the same comment. Luckily C# and Java handle division by zero nicely (returns infinity), so you can return the result directly. For Python, I specified that you should return None, since it will otherwise result in an exception.

  • Default User Avatar

    Same test since the beginning.

  • Custom User Avatar

    I have the same problem in python when trying to submit.
    I guess tests are using a combination of k and n values which is a bit too big for float :(

    I tried to use Decimal to wrap the failling calculation, and convert back the result to float - but I get back a systematic timeout from codewars.

    But what is strange is that 161 of 772 of completed katas are in python ... so I guess there is a way to overcome that if nothing has changed recently.