Ad
  • Custom User Avatar

    While I agree it can be improved as you said, I consider something as a kata issue if the user can't fix it changing his/her code. In this case, the problem comes from the user returning a different datatype from the expected one, and it can be fixed by the user, returning the expected one.

  • Custom User Avatar

    I would still consider crashing tests a kata issue. If tests want to use the returned value in a non-trivial way, it should be sanitised and not cause a crash.

  • Custom User Avatar

    Given s and x the task is to return as an integer ...

  • Custom User Avatar

    Well, you're returning a list instead of a number, that's your code's problem, not a kata issue.

  • Custom User Avatar

    This is what you have to figure out by yourself. The description gives all the elements to find the result. Minimum height posible just means what it says: if you find some combination but there exists another possibility that satisfies all the other requirements with 1st being lower, then your solution is incorrect. It's not as obvious as one could think at first sight, but I think any hint would definitively spoil the solution. If you cannot find it out, a good option can be to move on to other katas. Someday maybe the answer will pop into your mind with clarity.

  • Custom User Avatar
  • Custom User Avatar

    Apologies, fixed the typo, should now read:
    ('01222',2) creates 5 strings ("01,12,22,22,20")
    Thanks!

  • Custom User Avatar
    ~it == -it - 1
    ~-it == it - 1
    -~it == it + 1
    

    These equations hold for integers

  • Custom User Avatar

    _ is actually the var identifier. other symbols are bitwise operators, exactly equivalent to the computation youu see in the top solution (but the 2 terms of the multiplication are reversed, and no need for parentheses because of the precedence of bitwise operators)

    (convoluted answer to avoid the spoiler flag, but you should be able to find your way from there)

  • Custom User Avatar

    You have to mutate the input if it's not wave sorted and not change it otherwise. You don't have to return anything.

  • Custom User Avatar

    If input is below 0 or above 12 throw an exception

    Read that again.

  • Custom User Avatar

    raise Exception('error message')

  • Custom User Avatar

    those are red users. Without red account, use the filters in the katas page (second icon in the vertical left bar)

  • Custom User Avatar

    It's O(n^2), and it's possible to do it in O(1).

  • Custom User Avatar

    Your code seems to be not fast enough. Try doing it in another (faster) way.

  • Loading more items...