feat(content): more test cases
This commit is contained in:
@@ -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*.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user