feat(content): function signatures + test cases
This commit is contained in:
@@ -10,6 +10,24 @@ patterns:
|
||||
- tree-traversal
|
||||
- two-pointers
|
||||
|
||||
function_signature: "def get_all_elements(root1: TreeNode, root2: TreeNode) -> list[int]:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { root1: [2, 1, 4], root2: [1, 0, 3] }
|
||||
expected: [0, 1, 1, 2, 3, 4]
|
||||
- input: { root1: [1, null, 8], root2: [8, 1] }
|
||||
expected: [1, 1, 8, 8]
|
||||
hidden:
|
||||
- input: { root1: [], root2: [5, 1, 7] }
|
||||
expected: [1, 5, 7]
|
||||
- input: { root1: [1], root2: [] }
|
||||
expected: [1]
|
||||
- input: { root1: [], root2: [] }
|
||||
expected: []
|
||||
- input: { root1: [0, -10, 10], root2: [5, 1, 7, 0, 2] }
|
||||
expected: [-10, 0, 0, 1, 2, 5, 7, 10]
|
||||
|
||||
description: |
|
||||
Given two binary search trees `root1` and `root2`, return *a list containing all the integers from both trees sorted in **ascending** order*.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user