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 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.
see comments in the fork
Apologies, fixed the typo, should now read:
('01222',2) creates 5 strings ("01,12,22,22,20")
Thanks!
These equations hold for integers
_
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)
You have to mutate the input if it's not wave sorted and not change it otherwise. You don't have to return anything.
Read that again.
raise Exception('error message')
those are red users. Without red account, use the filters in the katas page (second icon in the vertical left bar)
It's O(n^2), and it's possible to do it in O(1).
Your code seems to be not fast enough. Try doing it in another (faster) way.
Yep, unfortunately your solution is a bit too slow. Try to optimize it and avoid all those repeated calculations.
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.
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.General answer, print the input to see what it is.
Loading more items...