Ad
  • Custom User Avatar

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

  • Custom User Avatar
    Traceback (most recent call last):
      File "/workspace/default/preloaded.py", line 165, in test_run
        raise Exception("Your proposed answer is {}, but the given answer is {}.".format(answer, truth))
    Exception: Your proposed answer is False, but the given answer is True.
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/workspace/default/tests.py", line 10, in <module>
        test.expect(test_run(answer, lines, node_count))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/workspace/default/preloaded.py", line 176, in test_run
        test.expect(False)
        ^^^^
    NameError: name 'test' is not defined
    
  • Custom User Avatar

    i cant understand what should i do if there are 2 coins in the same spot

    like---->>
    g = {0: {1, 2}, 1: {0, 4}, 2: {0}, 3: {3}, 4: {1, 4}, 5: set()}
    u1 = 2
    u2 = 2
    u3 = 0
    should 3
    why not None
    how....!!

  • Custom User Avatar

    Reraising issue from below:

    • Should use latest testing framework
    • Full tests produce far too much output (fills up the buffer) for incorrect solutions
  • Custom User Avatar

    The test suite is pretty bad.

    1. Why ~6100 assertions? That consumes ~2GB of memory on my browser, reduce it to 300-500. Other than that result of ~6000 assertions is always False.

    2. Why the result is (bool, tuple)? when it can be just a tuple and for unsolvable cases: ().

    3. This test from sample tests is misleading:

    print("Strange test case:")
    node_count = 5
    lines = [
        (1, 3, 0, 2),
        (2, 1, 0, 2),
        (3, 2, 2, 2),
        (4, 3, 0, 1),
        (4, 5, 0, 1),
        (5, 4, 1, 1),
    ]
    truth = None
    answer = generate_circulation(node_count, lines)
    test_run(truth, answer, lines, node_count)
    

    Why the truth value is None, when an assignment is possible(given that you've used truth = True for the other solvable cases in the same place)?

    1.  File "main.py", line 138, in generate_circulation_base_truth
           h = deque(['S'])
       NameError: name 'deque' is not defined
      
  • Custom User Avatar

    Inconsistent performance requirements across languages: max 4x2 in Python vs 25+ lengths in Haskell.

  • Custom User Avatar

    ( Haskell )

    evaluate [["a", "-a"]] `shouldBeElem` [Just ["a"], Just ["-a"]]
    

    Is this example test correct? I think Just [] would, or should, also be a correct answer.

    ( I haven't checked the submit tests. It's possible it's in there also. )

  • Custom User Avatar

    It looks like the Python original uses a legacy Python version, a legacy testing framework, inadequate test headers, and very limited testing.

    Also, as suggested elsewhere, please mention in the description that variable names will always be single letters.

    There's a world to be gained there.

    Note that I don't speak Python, so some of the above may be just plain wrong. But I sincerely doubt all of it is.

    Depending on performance requirements, my estimated rating might be anything from 6 to 3. It'd be worth it to specify any such requirements, or lack thereof. That would make it easier to settle on a design before starting implementing.

  • Custom User Avatar

    Haskell random tests:

    Falsifiable (after 2 tests): 
    expected: Just ["-x"]
     but got: Just ["x","-n"]
    [["-x","-n"]]
    
  • Custom User Avatar

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

  • Custom User Avatar

    Hi...

    • no random tests
    • no sample tests
    • how do you expect us to find out what to do if you don't give the definitions of the different notions...???