feat(content): more test cases
This commit is contained in:
@@ -9,6 +9,24 @@ categories:
|
||||
patterns:
|
||||
- two-pointers
|
||||
|
||||
function_signature: "def remove_duplicates(nums: list[int]) -> int:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { nums: [1, 1, 2] }
|
||||
expected: 2
|
||||
- input: { nums: [0, 0, 1, 1, 1, 2, 2, 3, 3, 4] }
|
||||
expected: 5
|
||||
- input: { nums: [1, 2, 3] }
|
||||
expected: 3
|
||||
hidden:
|
||||
- input: { nums: [1] }
|
||||
expected: 1
|
||||
- input: { nums: [1, 1, 1, 1, 1] }
|
||||
expected: 1
|
||||
- input: { nums: [-1, 0, 0, 1, 1, 2] }
|
||||
expected: 4
|
||||
|
||||
description: |
|
||||
Given an integer array `nums` sorted in **non-decreasing order**, remove the duplicates *in-place* such that each unique element appears only **once**. The **relative order** of the elements should be kept the **same**.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user