⌘K
Flycodx

Dream11 Team Equal Subset Partition

Dream11 Team Equal Subset Partition

HardDynamic Programming100% accepted

Dream11 needs to split players into two teams with equal total skill. Given an array of player skill ratings, determine if it can be partitioned into two subsets with equal sum.

Approach

Partition array into two equal-sum subsets (0/1 knapsack variant).

Input

4 1 5 11 5

Output

true
solution.py
Loading editor...
Test 1
Test 2
Test 3

Press Run to test your custom input, or Submit to judge against all test cases.

Sign in to continue

Create a free account to run code, submit solutions and track progress.

  • Free forever — no credit card
  • 10+ languages with live execution
  • Points, streaks & leaderboards
Auto Save OnLn 1, Col 1Spaces: 4UTF-8LFPython 3