Ad
  • Custom User Avatar

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

  • Custom User Avatar

    not enough random tests.

  • Custom User Avatar

    your solution is incorrect:

    shelve_trophies(2, 6, ['5.1.4', '4.#.1', '1.x.2', '1.1.3', '0.1.2', '4.1.5', '5.1.2'])
    expected 2 but was 1
    
    • 4.#.1 => 4 is on shelf 0
    • 4.1.5 or 5.1.4 => 5 is on 1
    • 5.1.2 => 2 is on 0
    • 0.1.2 => 0 is on 1
    • 1.x.2 => 1 is on 1
    • 1.1.3 => 3 is on 0

    all trophies positions are perfectly determined and there is only one solution.

  • Custom User Avatar

    your solution isn't robust enough:

    on these arguments: 5, 4, ['3.#.4', '3.1.0', '2.#.0', '1.x.2', '3.x.2', '1.#.3', '1.1.2'] 
    
    STDERR
    Traceback (most recent call last):
      File "main.py", line 95, in <module>
        test.assert_equals(n_shelves, answer(shelves, trophies, rules))
      File "main.py", line 52, in answer
        [1])]
    IndexError: list index out of range
    
  • Custom User Avatar

    Hi,

    Sounds interesting. But you forgot to give some information:

    • trophies seems to actually be 0-indexed.
    • what about the shelves? I guess it's the same?
    • should all shelves be used at least once or not?
    • max number of trophies per shelf?

    Aside of that:

    • you need more fixed tests (tests that are actually testing specific edge cases)
    • you need more random tests (and call them that way, not just "real tests". Those tests clearly aren't reality related... ;) )