feat(content): more test cases

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

View File

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