Pass 45: compute the permutations of an array