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.
Alright, but that was just an arbitrary number I put in so that it wouldn't time out. The thing is, no number in the actual test cases was that high.
I think the author somehow screwed with the Hash class to make it unusable for the solution. :/ as in, if you try to use this code for the solution it will just fail, period.
Can you give me an example of a case that it breaks on? I'm reading about loop detection now.
This comment is hidden because it contains spoiler information about the solution
This works. The challenge must be broken.
Why won't Hash work?? It works great in all my test cases. I'm using
object.object_id
to identify them.What's the
0
for at the end?In my opinion this is the best solution because it's generic. If the rules of the game change this will still hold with only minor changes. Keeping solutions to already solved problems to avoid crazy recursion complexity scaling is exactly what dynamic programming is. I did pretty much the same thing except by recording recursion answers using the @memorize decorator.
That's really interesting. Can you post your code? It didn't do this to me, so I'll need your code to test it.
Wow, I didn't know I could use
cmp
like that. Neat!Still doing it to me. Edit: reloaded page and it worked