Ad
  • Custom User Avatar
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    An essential kata for learning data structures.

  • Custom User Avatar

    Nice kata. I am learning Python, and this taught me a few ways to write faster code.

  • Custom User Avatar

    just look at the sample tests, everything is there. ;)

    matching this, in the description:

    Implements a Union command that adds a connection between point p and point q

  • Custom User Avatar

    done. Plz reset the trainer.

  • Custom User Avatar

    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'

  • Custom User Avatar

    What does the test "Allow update of path" consist of?
    You dont talk about update in kata's description

  • Custom User Avatar

    should be good, now. Reset the trainer if you still encounter it.

  • Custom User Avatar

    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'"

  • Custom User Avatar

    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.

  • Custom User Avatar

    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

  • Custom User Avatar

    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...

  • Custom User Avatar

    Shorted the description

  • Custom User Avatar

    The problem text could be quite a bit shorter while still conveying the same information as the text + the example tests.

  • Loading more items...