Problem 3109 · Medium

Find the Index of Permutation

Count the smaller unused values at each position and weight each count by the factorial of the positions still to come.

Open the interactive visualisation