Problem 629 · Hard

K Inverse Pairs Array

Count permutations of the numbers one through n that contain exactly k inversions. The visual builds up inversion counts one new element at a time and shows the running table.

Open the interactive visualisation