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.
Yes.
This comment is hidden because it contains spoiler information about the solution
An essential kata for learning data structures.
Nice kata. I am learning Python, and this taught me a few ways to write faster code.
just look at the sample tests, everything is there. ;)
matching this, in the description:
done. Plz reset the trainer.
When I run sample tests I have this:
STDERR
Traceback (most recent call last):
File "main.py", line 31, in
Test.expect(results1.connected(0,7),True , "Finds Valid Path")
File "/runner/frameworks/python/cw-2.py", line 22, in expect
display('FAILED', message)
File "/runner/frameworks/python/cw-2.py", line 14, in display
type.upper(), mode.upper(), label, format_message(message)))
File "/runner/frameworks/python/cw-2.py", line 9, in format_message
return message.replace("\n", "<:LF:>")
AttributeError: 'bool' object has no attribute 'replace'
What does the test "Allow update of path" consist of?
You dont talk about update in kata's description
should be good, now. Reset the trainer if you still encounter it.
When running tests on Python 3.4.3 or 2.7.6 I pass the first test, then:
"Traceback (most recent call last):
File "main.py", line 23, in
Test.expect(results1.connected(8,9),True , "Finds Valid Path")
File "/runner/frameworks/python/cw-2.py", line 22, in expect
display('FAILED', message)
File "/runner/frameworks/python/cw-2.py", line 14, in display
type.upper(), mode.upper(), label, format_message(message)))
File "/runner/frameworks/python/cw-2.py", line 9, in format_message
return message.replace("\n", "<:LF:>")
AttributeError: 'bool' object has no attribute 'replace'"
your approach is good but I guess you missed the very same "micro"-optimization that I did => try to think about something that you may currently be doing again and again and that you could avoid.
You are 14.0 times faster than the naive solution (100 nodes)
You are 143.0 times faster than the naive solution (1000 nodes)
Execution Timed Out (12000 ms)
I just... how?! This is also with a lot of debug code. Normally it's closer to 20x for the first 100 nodes
Well... I'm a bit confused, right now : my solution is 6-6.5 times faster than the naive one, but it still does not pass the whole bunch of tests...
I will try some little changes, but I'm out of inspiration, if this is not a server issue (but I tried several times...). Are you sure that your tests are not demanding too much ? ("a bit", I mean ;-) )
By the way, in the sample tests, you should modify the text of the last one : "Must Be at Least Four Times as Fast ", considering you use as condition
result of th integer division > 3
.Very interesting kata anyway. I really hope I will find a way through it...
Shorted the description
The problem text could be quite a bit shorter while still conveying the same information as the text + the example tests.
Loading more items...