An algorithm for all possible arrays in a order of distance from original
Give an array of arrays. I’d like to generate all arrays formed by picking the first element from the first array in the input, the second element in the second array and so on.