feat(content): hidden test cases

This commit is contained in:
2025-08-06 23:21:42 +01:00
parent 72f7833c6c
commit a1a4eeaed7
134 changed files with 2075 additions and 0 deletions

View File

@@ -10,6 +10,26 @@ categories:
patterns:
- backtracking
function_signature: "def can_partition_k_subsets(nums: list[int], k: int) -> bool:"
test_cases:
visible:
- input: { nums: [4, 3, 2, 3, 5, 2, 1], k: 4 }
expected: true
- input: { nums: [1, 2, 3, 4], k: 3 }
expected: false
hidden:
- input: { nums: [1], k: 1 }
expected: true
- input: { nums: [1, 1, 1, 1], k: 4 }
expected: true
- input: { nums: [1, 1, 1, 1], k: 2 }
expected: true
- input: { nums: [2, 2, 2, 2, 3, 4, 5], k: 4 }
expected: false
- input: { nums: [10, 10, 10, 7, 7, 7, 7, 7, 7, 6, 6, 6], k: 3 }
expected: true
description: |
Given an integer array `nums` and an integer `k`, return `true` if it is possible to divide this array into `k` non-empty subsets whose sums are all equal.