array: find next permutation