Apple - Partition array to K sum

Anonymous User
1731
Jun 01, 2020
Jun 03, 2020

Given an array of integers nums and a positive sum k & it's possible to divide this array into non-empty subsets whose sums are equal to K.
Return the list of sub arrays.

Example 1:

Input: nums = [0,2,4,2,0,4], k = 4
Output: [0,2,2],[0,4],[4] or [0,0,2,2],[4],[4] or.... Return any list of sub arrays/ list of sub lists.
Explanation: 0+2+2 = 4 , 0+4 =4 , 4=4
or 0+0+2+2 = 4, 4=4 , 4=4

Comments (9)