final version of generating lexiPermutations.
Resolve Problem24.