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

@@ -10,6 +10,26 @@ categories:
patterns:
- backtracking
function_signature: "def subsets_with_dup(nums: list[int]) -> list[list[int]]:"
test_cases:
visible:
- input: { nums: [1, 2, 2] }
expected: [[], [1], [1, 2], [1, 2, 2], [2], [2, 2]]
- input: { nums: [0] }
expected: [[], [0]]
hidden:
- input: { nums: [4, 4, 4, 1, 4] }
expected: [[], [1], [1, 4], [1, 4, 4], [1, 4, 4, 4], [1, 4, 4, 4, 4], [4], [4, 4], [4, 4, 4], [4, 4, 4, 4]]
- input: { nums: [1, 1] }
expected: [[], [1], [1, 1]]
- input: { nums: [1, 2, 3] }
expected: [[], [1], [1, 2], [1, 2, 3], [1, 3], [2], [2, 3], [3]]
- input: { nums: [5, 5, 5] }
expected: [[], [5], [5, 5], [5, 5, 5]]
- input: { nums: [3, 1, 2, 1] }
expected: [[], [1], [1, 1], [1, 1, 2], [1, 1, 2, 3], [1, 1, 3], [1, 2], [1, 2, 3], [1, 3], [2], [2, 3], [3]]
description: |
Given an integer array `nums` that may contain duplicates, return *all possible subsets* (the power set).