Tap here to switch tabs
Problem
Submissions

Problem: Partition to K Equal Sum Subsets

Partition to K Equal Sum Subsets asks whether an integer array can be divided into k nonempty groups whose sums are all equal, returning true or false.

Statement

Given an integer array nums and an integer k, return true if it is possible to partition nums into k non empty subsets such that the sum of elements in every subset is equal, or false otherwise.

Constraints:

  • 1≤1 \leq k ≤\leq nums.length ≤16\leq 16

  • 1≤1 \leq nums[i] ≤104\leq 10^4

  • The frequency of each element is in the range [1,4][1, 4].

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Partition to K Equal Sum Subsets

Partition to K Equal Sum Subsets asks whether an integer array can be divided into k nonempty groups whose sums are all equal, returning true or false.

Statement

Given an integer array nums and an integer k, return true if it is possible to partition nums into k non empty subsets such that the sum of elements in every subset is equal, or false otherwise.

Constraints:

  • 1≤1 \leq k ≤\leq nums.length ≤16\leq 16

  • 1≤1 \leq nums[i] ≤104\leq 10^4

  • The frequency of each element is in the range [1,4][1, 4].