feat(content): hidden test cases

This commit is contained in:
2025-08-06 23:21:42 +01:00
parent 89b5dd1457
commit 6bed0a6787
134 changed files with 2075 additions and 0 deletions

View File

@@ -10,6 +10,26 @@ categories:
patterns:
- backtracking
function_signature: "def permute_unique(nums: list[int]) -> list[list[int]]:"
test_cases:
visible:
- input: { nums: [1, 1, 2] }
expected: [[1, 1, 2], [1, 2, 1], [2, 1, 1]]
- input: { nums: [1, 2, 3] }
expected: [[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]
hidden:
- input: { nums: [1] }
expected: [[1]]
- input: { nums: [1, 1] }
expected: [[1, 1]]
- input: { nums: [1, 2] }
expected: [[1, 2], [2, 1]]
- input: { nums: [1, 1, 1] }
expected: [[1, 1, 1]]
- input: { nums: [0, 1, 0, 0, 9] }
expected: [[0, 0, 0, 1, 9], [0, 0, 0, 9, 1], [0, 0, 1, 0, 9], [0, 0, 1, 9, 0], [0, 0, 9, 0, 1], [0, 0, 9, 1, 0], [0, 1, 0, 0, 9], [0, 1, 0, 9, 0], [0, 1, 9, 0, 0], [0, 9, 0, 0, 1], [0, 9, 0, 1, 0], [0, 9, 1, 0, 0], [1, 0, 0, 0, 9], [1, 0, 0, 9, 0], [1, 0, 9, 0, 0], [1, 9, 0, 0, 0], [9, 0, 0, 0, 1], [9, 0, 0, 1, 0], [9, 0, 1, 0, 0], [9, 1, 0, 0, 0]]
description: |
Given a collection of numbers, `nums`, that might contain duplicates, return *all possible unique permutations **in any order***.