So I have a problem dealing with permutations of lists/strings, which I am having a hard time solving.
So, say I have several Lists:
list1 = ["a"]
list2 = ["a","b","c","d"]
list3 = ["b","e"]
list4 = ["f","g","a"]
I need to calculate the number of all possible combinations of permutations while choosing 1 character from each list. So, from the first list, I choose a character. "a", in this case since there is only one item in the list. Next I select an item from the second list, but it CAN'T BE "a", as that was chosen in my previous list, so it could be "b", "c", or "d". Next I choose an item from the third list, and if I chose "a" in the first, and "b", in the second, I could only choose "e", as "b" was already used previously. The same goes for the fourth list.
So I need to calculate all of the possible combinations of unique character combinations from my lists. Hopefully everyone gets what I'm asking here. Or if possible, I don't even need to create the lists of permutations, I just need to calculate HOW MANY combinations there are total. Whatever would be less memory intensive as there may be a large number of individual lists in the actual problem
To be more verbose with my question... If I had two lists: list1 = ["a"] list2 = ["b"]
There would only be one combination, as you preserve the location in the permuted strings. List one does not contain a b, so the only combination could be ("a","b"), not ("b","a"). And to further extends the constraints of this question .. I don't necessarily want to retrieve the results of all the permutations, I want to only return the TOTAL NUMBER of possible permutations. Returning the results takes up too much memory, as I will be working with rougly fifteen lists, of 1 to 15 characters in each list.