Imagine we have a set S = [a,b,c,d,e,f]. And we have a set N = [1,2,3].
How can we assign elements of S to elements of N in all possible combinations?
The desired result will hold something like this:
- [1,[a]], [2,[b,c]], [3,[d,e,f]].
- [1,[a]], [2,[b,c,d]],[3,[e,f]].
- etc.
Is it a powerset generation problem or anything else? How can I find its complexity and space complexity?
How can I generate those subsets?
This problem is related to the powerset generation. You will get |N|^|S| possible mappings.