K Sum - Target Sum Unique Set
hard
1. Given an array nums of 'n' integers and a variable 'K'. 2. You have to return an array of all the unique set [nums[a], nums[b], nums[c], nums[d] . . . K Elements] such that: 2.1 a, b, c, d . . . K Elements are less than 'n' and greater than 0. 2.2 a,. b, c, d upto K different indexes are Unique. 2.3 nums[a] + nums[b] + nums[c] + nums[d] + . . . + nums[K distinct indexes] == target. 3. You can return answer in any order.
Constraints
1. 1 <= nums.length <= 200 2. -10^9 <= nums[i] <= 10^9 3. -10^9 <= target <= 10^9 4. 1 <= K <= nums.length
Format
Input
Input is managed for you.
Output
Output is managed for you.
Example
Sample Input
6
-1 0 1 2 -1 -4
0
3
Sample Output
-1 -1 2
-1 0 1