feat(content): more test cases

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

View File

@@ -9,6 +9,24 @@ patterns:
- union-find
- dfs
function_signature: "def find_redundant_connection(edges: list[list[int]]) -> list[int]:"
test_cases:
visible:
- input: { edges: [[1, 2], [1, 3], [2, 3]] }
expected: [2, 3]
- input: { edges: [[1, 2], [2, 3], [3, 4], [1, 4], [1, 5]] }
expected: [1, 4]
hidden:
- input: { edges: [[1, 2], [2, 3], [3, 1]] }
expected: [3, 1]
- input: { edges: [[1, 4], [3, 4], [1, 3], [1, 2], [4, 5]] }
expected: [1, 3]
- input: { edges: [[1, 5], [3, 4], [3, 5], [4, 5], [2, 4]] }
expected: [4, 5]
- input: { edges: [[9, 10], [5, 8], [2, 6], [1, 5], [3, 8], [4, 9], [8, 10], [4, 10], [6, 8], [7, 9]] }
expected: [4, 10]
description: |
In this problem, a tree is an **undirected graph** that is connected and has no cycles.