Ad
  • Custom User Avatar

    Chuck Norris wasn't developed code, code itself was developed for Chuck Norris...

  • Custom User Avatar

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

  • Custom User Avatar

    Testing for [0, 79] and 0:
    [0, 79] should equal None,
    but 0 * 79 == 0...

  • Custom User Avatar

    python: error on Fixed Tests 4:

    right = ['The number is an even number', 'The number is divisible by 4']
    wrong = ['The number is divisible by 3']
    test.assert_equals(guess_number(right, wrong), None)
    

    currect result: 4

  • Custom User Avatar

    I advise you to use completely random tests, otherwise you can solve this kata, for example, in the same way:

    def press(k: int, n: int) -> list[int]:
        b = n.bit_length()
        return {
            (3, 3): [0, 1, 0],
            (3, 4): [1, 1, 0],
            (4, 3): [0, 0, 1, 0],
            (4, 4): [0, 1, 1, 0],
            (4, 6): [0, 1, 0, 1],
            (4, 7): [0, 1, 0, 0],
            (4, 8): [1, 1, 0, 0],
            (4, 9): [1, 1, 0, 1],
            (6, 26): [0, 1, 0, 1, 1, 1],
            (6, 41): [1, 1, 1, 1, 0, 1],
            (8, 53): [0, 0, 1, 0, 1, 1, 1, 1],
            (8, 168): [1, 1, 1, 1, 1, 1, 0, 0],
            (10, 1000): [1, 0, 0, 0, 0, 1, 1, 1, 0, 0],
        }.get((k, n), [0] * (k - b) + [1] * b)