SP1712 PRMLX - Permalex
Description
Given a string of characters, we can permute the individual characters to make new strings. If we can impose an ordering on the characters (say alphabetic sequence), then the strings themselves can be ordered and any given permutation can be given a unique number designating its position in that ordering. For example the string `acab' gives rise to the following 12 distinct permutations:
aabc 1 acab 5 bcaa 9 aacb 2 acba 6 caab 10 abac 3 baac 7 caba 11 abca 4 baca 8 cbaa 12
Input Format
N/A
Output Format
N/A