feat(content): more test cases

This commit is contained in:
2025-07-13 19:25:39 +01:00
parent d2b74b6863
commit 85fea3a4bb
94 changed files with 1840 additions and 0 deletions

View File

@@ -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*.