feat(content): more test cases
This commit is contained in:
@@ -9,6 +9,28 @@ categories:
|
||||
patterns:
|
||||
- backtracking
|
||||
|
||||
function_signature: "def subsets(nums: list[int]) -> list[list[int]]:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { nums: [1, 2, 3] }
|
||||
expected: [[], [1], [2], [1, 2], [3], [1, 3], [2, 3], [1, 2, 3]]
|
||||
- input: { nums: [0] }
|
||||
expected: [[], [0]]
|
||||
- input: { nums: [1, 2] }
|
||||
expected: [[], [1], [2], [1, 2]]
|
||||
hidden:
|
||||
- input: { nums: [] }
|
||||
expected: [[]]
|
||||
- input: { nums: [5, 10, 15] }
|
||||
expected: [[], [5], [10], [5, 10], [15], [5, 15], [10, 15], [5, 10, 15]]
|
||||
- input: { nums: [-1, 0, 1] }
|
||||
expected: [[], [-1], [0], [-1, 0], [1], [-1, 1], [0, 1], [-1, 0, 1]]
|
||||
- input: { nums: [1, 2, 3, 4] }
|
||||
expected: [[], [1], [2], [1, 2], [3], [1, 3], [2, 3], [1, 2, 3], [4], [1, 4], [2, 4], [1, 2, 4], [3, 4], [1, 3, 4], [2, 3, 4], [1, 2, 3, 4]]
|
||||
- input: { nums: [9] }
|
||||
expected: [[], [9]]
|
||||
|
||||
description: |
|
||||
Given an integer array `nums` of **unique** elements, return *all possible subsets* (the power set).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user