Consider this example of inverting the order of numbers from 0 to 10:
x -> 10-x
This inverts the order in a bijective way. If I put in 100 numbers from 0 to 10 and it holds a < b
for some a and b, then after applying the above formula, it holds a > b
for all those a, b.
I need the same thing for lexicographic order. I have a string of the fixed length 10. How can I invert the lexicographic order?
It would be quite simple to do if it would only contain a-z
. But it can also contain numbers and -, _
and it is case sensitive.
Does someone know how to do that?