Learnacy Lab
Each bar is lifted and slid left into a sorted prefix; the total number of shifts is exactly the number of inverted pairs.