feat(content): more test cases

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

View File

@@ -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**.