Aim: Find a larger permutation
We must move a larger number forward. So we should go from the tail to find any new number is smaller than a number behind it. If no next permutation, reverse list.
def next_permutation(l): '''Give out the next permutation of list l >>> next_permutation …