Add solution for 'next permutation'.