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