Find all lexicographically previous permutations of a string
Given a string sorted in descending order, find all lexicographically previous permutations of it. In the lexicographic order, the words are arranged similarly as they are presumed to appear in a dictionary.