feat(content): more test cases
This commit is contained in:
@@ -10,6 +10,24 @@ patterns:
|
||||
- dfs
|
||||
- tree-traversal
|
||||
|
||||
function_signature: "def kth_smallest(root: TreeNode | None, k: int) -> int:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { root: [3, 1, 4, null, 2], k: 1 }
|
||||
expected: 1
|
||||
- input: { root: [5, 3, 6, 2, 4, null, null, 1], k: 3 }
|
||||
expected: 3
|
||||
- input: { root: [1], k: 1 }
|
||||
expected: 1
|
||||
hidden:
|
||||
- input: { root: [2, 1, 3], k: 2 }
|
||||
expected: 2
|
||||
- input: { root: [5, 3, 6, 2, 4, null, null, 1], k: 6 }
|
||||
expected: 6
|
||||
- input: { root: [3, 1, 4, null, 2], k: 4 }
|
||||
expected: 4
|
||||
|
||||
description: |
|
||||
Given the `root` of a binary search tree, and an integer `k`, return the `k`<sup>th</sup> smallest value (**1-indexed**) of all the values of the nodes in the tree.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user