feat(content): more test cases
This commit is contained in:
@@ -11,6 +11,24 @@ patterns:
|
||||
- bfs
|
||||
- tree-traversal
|
||||
|
||||
function_signature: "def max_depth(root: TreeNode | None) -> int:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { root: [3, 9, 20, null, null, 15, 7] }
|
||||
expected: 3
|
||||
- input: { root: [1, null, 2] }
|
||||
expected: 2
|
||||
- input: { root: [] }
|
||||
expected: 0
|
||||
hidden:
|
||||
- input: { root: [1] }
|
||||
expected: 1
|
||||
- input: { root: [1, 2, 3, 4, 5] }
|
||||
expected: 3
|
||||
- input: { root: [1, 2, null, 3, null, 4] }
|
||||
expected: 4
|
||||
|
||||
description: |
|
||||
Given the `root` of a binary tree, return *its maximum depth*.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user