permutation: Generate permutations of arrays