Trying jump game again
This commit is contained in:
@@ -249,3 +249,48 @@ def test_binary_tree_from_preorder_inorder(
|
||||
preorder: list[int], inorder: list[int], expected: stdlib.BinaryTreeNode
|
||||
):
|
||||
assert stuff.binary_tree_from_preorder_inorder(preorder, inorder) == expected
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("board", "expected"),
|
||||
[
|
||||
(
|
||||
[2, 3, 1, 1, 4],
|
||||
[
|
||||
[0, 1, 2, 3, 4],
|
||||
[0, 1, 3, 4],
|
||||
[0, 1, 4],
|
||||
[0, 2, 3, 4],
|
||||
],
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_collect_complete_jump_paths_from_board(
|
||||
board: list[int], expected: list[list[int]]
|
||||
):
|
||||
assert list(sorted(stuff.collect_complete_jump_paths_from_board(board))) == expected
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("board", "expected"),
|
||||
[
|
||||
(
|
||||
[2, 3, 1, 1, 4],
|
||||
2,
|
||||
),
|
||||
(
|
||||
[2, 3, 0, 1, 4],
|
||||
2,
|
||||
),
|
||||
(
|
||||
[1],
|
||||
0,
|
||||
),
|
||||
(
|
||||
[1, 2],
|
||||
1,
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_count_min_jumps_from_board(board: list[int], expected: int):
|
||||
assert stuff.count_min_jumps_from_board(board) == expected
|
||||
|
||||
Reference in New Issue
Block a user