I have three lists.
x = {a,b,c,d}
y = {A,B,C}
z = {{1,2,3},{4,5,6},{7,8,9},{10,11,12}}
and I wish to construct the following list out of these three lists
{{a,A,1},{a,B,2},{a,C,3},{b,A,4},{b,B,5},{b,C,6},{c,A,7},{c,B,8},{c,C,9},{d,A,10},{d,B,11},{d,C,12}}
In the above list, every sublist or z
is matched to an element in x
and every item within a sublist in z
is matched with an element in y
.
How can I achieve this?