Tag Archives: next even

Next even permutation of a number

Given a number N. Find the smallest even number greater than N such that the digits are a permutation of the number N. A trivial solution to start with would be to generate all the permutations of digits of the given number and then sort all the permutations. The first even permutation in the sorted […]