feat(content): function signatures + test cases
This commit is contained in:
@@ -10,6 +10,26 @@ patterns:
|
||||
- dfs
|
||||
- greedy
|
||||
|
||||
function_signature: "def min_camera_cover(root: TreeNode) -> int:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { root: [0, 0, null, 0, 0] }
|
||||
expected: 1
|
||||
- input: { root: [0, 0, null, 0, null, 0, null, null, 0] }
|
||||
expected: 2
|
||||
hidden:
|
||||
- input: { root: [0] }
|
||||
expected: 1
|
||||
- input: { root: [0, 0] }
|
||||
expected: 1
|
||||
- input: { root: [0, 0, 0] }
|
||||
expected: 1
|
||||
- input: { root: [0, 0, 0, 0, 0, 0, 0] }
|
||||
expected: 2
|
||||
- input: { root: [0, 0, null, 0, null, 0, null, 0] }
|
||||
expected: 2
|
||||
|
||||
description: |
|
||||
You are given the `root` of a binary tree. We install cameras on the tree nodes where each camera at a node can monitor its parent, itself, and its immediate children.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user