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.
The constraints were meant to limit the space complexity to constant which is definitely useful in memory-constrained platforms such as embeded systems or even in a large scale data streaming application which can't store everything in the memory.
Either your algorithm is inefficient (I haven't done Ruby version but I assume that it requires a linear solution), or you're running into an infinite loop.
thanks
Just don't get into the infinite loop (it's not really mathematic as well).
You can solve this very easily if you pay close attention... Now it's your turn to think ;)
Your code has 2 problem:
Good luck
This comment is hidden because it contains spoiler information about the solution
It is hard to say, please post your source code in replay.
No issue here, you're facing EXACTLY the goal of the kata. ;)
Pursuie your researches about that and keep in mind the title:
... (and why your code fails in some katas)
Results are case-insensitive; "DDD" is the same as "DdD" is the same as "ddd". So, 7 e's, four ddd's, three aa's.
I would have accepted your complain if the simple solution had been the only way to solve it. And you saw the note in beginning to inform you that it is going to be more difficult than 8 kyu normal kata.
This comment is hidden because it contains spoiler information about the solution
Yes. :)
It's called a "ternary operator" if you want to look up more information about it.
Haha, nice.
I guess you can try solve it again :)
I'm gonna put my previous comment in spoilers then so other ppl can't see it.
However, it seems like you have nested while loops, which seems like it would be O(n^2) complexity, but you need O(n) to pass the tests.
If you need any more help, you can just post your code in spoilers.
This comment is hidden because it contains spoiler information about the solution
Seems the subpattern there is
123a
repeated 3 times and shuffled. Not an issue, use question instead.Loading more items...