feat(content): more test cases

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

View File

@@ -9,6 +9,24 @@ categories:
patterns:
- union-find
function_signature: "def longest_consecutive(nums: list[int]) -> int:"
test_cases:
visible:
- input: { nums: [100, 4, 200, 1, 3, 2] }
expected: 4
- input: { nums: [0, 3, 7, 2, 5, 8, 4, 6, 0, 1] }
expected: 9
hidden:
- input: { nums: [] }
expected: 0
- input: { nums: [1, 0, 1, 2] }
expected: 3
- input: { nums: [9, 1, 4, 7, 3, -1, 0, 5, 8, -1, 6] }
expected: 7
- input: { nums: [1] }
expected: 1
description: |
Given an unsorted array of integers `nums`, return *the length of the longest consecutive elements sequence*.