feat(content): more test cases

This commit is contained in:
2025-07-13 19:25:39 +01:00
parent e28da5def2
commit 0f264ef603
94 changed files with 1840 additions and 0 deletions

View File

@@ -9,6 +9,24 @@ categories:
patterns:
- dynamic-programming
function_signature: "def can_partition(nums: list[int]) -> bool:"
test_cases:
visible:
- input: { nums: [1, 5, 11, 5] }
expected: true
- input: { nums: [1, 2, 3, 5] }
expected: false
- input: { nums: [1, 2, 5] }
expected: false
hidden:
- input: { nums: [1, 1] }
expected: true
- input: { nums: [2, 2, 1, 1] }
expected: true
- input: { nums: [100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 99, 97] }
expected: false
description: |
Given an integer array `nums`, return `true` *if you can partition the array into two subsets such that the sum of the elements in both subsets is equal* or `false` *otherwise*.