Simplify isPermutationSort