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.
At first I wanted to say it is best practice but it takes a lot to understand the tricks that make it work. It is extremelly clever though but I would not say this is easy to modify if the code has to evolve. The changing direction condition is particularly difficult to read and this is probably why you added the comments but it could be a lot clearer by splitting into multiple "elif" in my opinion.
I really like the self.moving and it is clever the way you use it in areSomeGuysWaitingSameWay_AtThatFloor and areSomeGuysWaitingOtherWay_AtThatFloor.
Sample test error message for 'bob' is wrong, it's testing for true instead of for false.
The sample test for test "aa" and "bob" expect false when they are in fact plaindromes.
actually "T[space]T"
Duration of execution is a criteria but this shouldn't be THE criteria to determine the best solution. The best solution should be a fine balance between complexity(related to execution time), readability and best practice.
Great,thank you!
Approved
Needed the new comment to resolve the issue.
Needed the new comment to resolve the issue.
Thanks for your findings. I have reduce the number for the last case then. Hope the issue never happen after this update.
I think that in your case the comments don't make the code easier to read and understand otherwise your solution is clean. Maybe just less efficient since you used a dict instead of a set.
Also you did the same "mistake" i did, you can get rid of the else statment because you always want to add the checked value.
had two issue before completing the kata with exactly the same code:
first attempt I got:
Signal:
Process exited prematurely with a SIGKILL signal.
second one i got this:
STDERR:
Traceback:
in
File "./frameworks/python/cw-2.py", line 22, in assert_equals
equals_msg = "{0} should equal {1}".format(repr(actual), repr(expected))
MemoryError
finally on the third attempt it passes