Ad
  • 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
  • Default 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.

  • Custom User Avatar

    Yep, unfortunately your solution is a bit too slow. Try to optimize it and avoid all those repeated calculations.

  • Custom User Avatar

    Are you sure you don't have an infinite loop with some input value? Also, it'll mark all test passed until the timeout exception is raised, but that doesn't mean you passed all the kata tests.

  • Default User Avatar

    It's language-specific. But the general answer is to log the input. So for example, in python, you'd use print(argname). Some katas log all inputs by default, but most don't.

  • Custom User Avatar

    General answer, print the input to see what it is.

  • Loading more items...