feat(content): more test cases

This commit is contained in:
2025-07-13 19:25:39 +01:00
parent 98ebb1600f
commit 16b02451d0
94 changed files with 1840 additions and 0 deletions

View File

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