I have a list of maps in Python looking like this:
2: a, b
3: b, c, d
4: a
And I want to create all conbinations of key-value-pairs, i.e.:
(2,a)(3,b)(4,a)
(2,a)(3,c)(4,a)
(2,a)(3,d)(4,a)
(2,b)(3,b)(4,a)
(2,b)(3,c)(4,a)
(2,b)(3,d)(4,a)
I neither know the size of the maps nor the size of the list, but the list will never have more than 4 elements. I can assume that the keys are unique but not that they are always 1,2,3,4 or 0,1,2,3 as depicted in the example above.
What is the smartest/most efficient way to solve this?