Add implementation of prev_permutation and combination.