I have a few Lists of Strings. for example:
List<
String> AList contains {"a1","a2","a3","a4"}
List<String> BList contains {"b1","b2","b3"}
List<String> CList contains {"c1","c2","c3","c4","c5"}
List<String> DList contains {"d1","d2"}
so on and so forth. The number of lists is variable and number of Strings in the list is also variable. I want to write a code that returns ALL POSSIBLE combinations under the following conditions:
1) each set contains at least two elements. In this example the each set will contain 2 to 5 elements. - example: {"a1","b1"} or {"c2","b3","d2"}
2) each element in a set is from different lists - example: {"c1","c4"} or {"b1","b2","a4"} both are invalid.
3) each set has unique combination of elements - example: {"a3", "d2", "b4"} is equivalent to {"d2", "a3", "b4"} hence if {"a3", "d2", "b4"} is returned in the results {"d2", "a3", "b4"} should not be returned.
Please help.
Regards,
B Phadnis