Creating a tuple from combination of tuple and vectors

This will give you Vector{Tuple{Int64, Int64, Int64}}

[(i, j, D[idx]) for (idx, i) in enumerate(B) for j in C[idx] if (i, j) in A]
2 Likes