For this reason it does not seem useful, although certainly possible, to employ a special data
structure that would allow performing the conversion from Lehmer code to permutation in O(n log n) time.
Moreover, the positions of the zeroes in the inversion table give the values of left-to-right maxima of the permutation( in the example 6, 8, 9)
while the positions of the zeroes in the Lehmer code are the positions of the right-to-left minima(
in the example positions the 4, 8, 9 of the values 1, 2, 5); this allows computing the distribution of such extrema among all permutations.