feat(content): more test cases
This commit is contained in:
@@ -10,6 +10,24 @@ patterns:
|
||||
- dfs
|
||||
- tree-traversal
|
||||
|
||||
function_signature: "def is_same_tree(p: TreeNode | None, q: TreeNode | None) -> bool:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { p: [1, 2, 3], q: [1, 2, 3] }
|
||||
expected: true
|
||||
- input: { p: [1, 2], q: [1, null, 2] }
|
||||
expected: false
|
||||
- input: { p: [1, 2, 1], q: [1, 1, 2] }
|
||||
expected: false
|
||||
hidden:
|
||||
- input: { p: [], q: [] }
|
||||
expected: true
|
||||
- input: { p: [1], q: [] }
|
||||
expected: false
|
||||
- input: { p: [1, 2, 3, 4, 5], q: [1, 2, 3, 4, 5] }
|
||||
expected: true
|
||||
|
||||
description: |
|
||||
Given the roots of two binary trees `p` and `q`, write a function to check if they are the same or not.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user