Learnacy Lab
Lift each bar and slide it left into a sorted prefix. Count every shift as it undoes one inversion in the row.