feat(content): more test cases
This commit is contained in:
@@ -10,6 +10,24 @@ patterns:
|
||||
- dfs
|
||||
- tree-traversal
|
||||
|
||||
function_signature: "def is_valid_bst(root: TreeNode | None) -> bool:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { root: [2, 1, 3] }
|
||||
expected: true
|
||||
- input: { root: [5, 1, 4, null, null, 3, 6] }
|
||||
expected: false
|
||||
- input: { root: [1] }
|
||||
expected: true
|
||||
hidden:
|
||||
- input: { root: [5, 4, 6, null, null, 3, 7] }
|
||||
expected: false
|
||||
- input: { root: [2, 2, 2] }
|
||||
expected: false
|
||||
- input: { root: [10, 5, 15, null, null, 6, 20] }
|
||||
expected: false
|
||||
|
||||
description: |
|
||||
Given the `root` of a binary tree, determine if it is a valid **binary search tree (BST)**.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user