feat(content): more test cases
This commit is contained in:
@@ -11,6 +11,24 @@ patterns:
|
||||
- dfs
|
||||
- bfs
|
||||
|
||||
function_signature: "def invert_tree(root: TreeNode | None) -> TreeNode | None:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { root: [4, 2, 7, 1, 3, 6, 9] }
|
||||
expected: [4, 7, 2, 9, 6, 3, 1]
|
||||
- input: { root: [2, 1, 3] }
|
||||
expected: [2, 3, 1]
|
||||
- input: { root: [] }
|
||||
expected: []
|
||||
hidden:
|
||||
- input: { root: [1] }
|
||||
expected: [1]
|
||||
- input: { root: [1, 2] }
|
||||
expected: [1, null, 2]
|
||||
- input: { root: [1, null, 2] }
|
||||
expected: [1, 2]
|
||||
|
||||
description: |
|
||||
Given the `root` of a binary tree, invert the tree, and return *its root*.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user