Apple - Partition array to K sum
Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2020-06-01Added By Anonymous
Source: Link
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