remove elem and next permutation