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.
Is it a really best practices to raname key word 'type'?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Hmm. Good point. Perhaps
ball_type
orballType
would have been better. :-/In general I would not view this solution as best practices because the built-in function "type" is being masked. Am I wrong to think so in this context?
Next time please create a kumite directly on the kata instead, so that the solution is not available for everyone to see.
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.
Using a hash will break in certain cases. Try reading about loop detection on wikipedia or stackoverflow for alternative strategies.
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.
Loading more items...