feat(content): hidden test cases

This commit is contained in:
2025-08-06 23:21:42 +01:00
parent 8544efb5bf
commit e0bf8cda01
134 changed files with 2075 additions and 0 deletions

View File

@@ -10,6 +10,26 @@ patterns:
- bfs
- tree-traversal
function_signature: "def find_min_height_trees(n: int, edges: list[list[int]]) -> list[int]:"
test_cases:
visible:
- input: { n: 4, edges: [[1, 0], [1, 2], [1, 3]] }
expected: [1]
- input: { n: 6, edges: [[3, 0], [3, 1], [3, 2], [3, 4], [5, 4]] }
expected: [3, 4]
hidden:
- input: { n: 1, edges: [] }
expected: [0]
- input: { n: 2, edges: [[0, 1]] }
expected: [0, 1]
- input: { n: 3, edges: [[0, 1], [1, 2]] }
expected: [1]
- input: { n: 7, edges: [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6]] }
expected: [3]
- input: { n: 8, edges: [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7]] }
expected: [3, 4]
description: |
A tree is an undirected graph in which any two vertices are connected by *exactly* one path. In other words, any connected graph without simple cycles is a tree.