feat(content): function signatures + test cases

This commit is contained in:
2025-07-13 19:53:34 +01:00
parent 9e6c6d256f
commit 65a8d525f5
203 changed files with 4526 additions and 0 deletions

View File

@@ -10,6 +10,28 @@ patterns:
- dfs
- tree-traversal
function_signature: "def is_balanced(root: TreeNode) -> bool:"
test_cases:
visible:
- input: { root: [3, 9, 20, null, null, 15, 7] }
expected: true
- input: { root: [1, 2, 2, 3, 3, null, null, 4, 4] }
expected: false
- input: { root: [] }
expected: true
hidden:
- input: { root: [1] }
expected: true
- input: { root: [1, 2, null, 3] }
expected: false
- input: { root: [1, null, 2, null, 3] }
expected: false
- input: { root: [1, 2, 3, 4, 5, 6, 7] }
expected: true
- input: { root: [1, 2, 2, 3, null, null, 3, 4, null, null, 4] }
expected: false
description: |
Given a binary tree, determine if it is **height-balanced**.