Dodomeki
Sign in

91. Partition into Two Groups

Medium

Given an array numeros of non-negative integers, determine whether it is possible to split it into two groups with equal sum. Each position must belong to exactly one group.

Example 1
Input: numeros = [1, 5, 11, 5]
Output: true
Explanation: The groups [1, 5, 5] and [11] both have sum 11.
Example 2
Input: numeros = [1, 2, 5]
Output: false
Constraints
  • 1 <= numeros.length <= 200
  • 0 <= numeros[i] <= 100
Dynamic programmingArrays
Caso 1
numeros =
[1,5,11,5]
Expected =
true
Caso 2
numeros =
[1,2,5]
Expected =
false

Run checks these 2 cases. Submit runs all 6, including hidden ones.