Mental Model
Count how many pairs of numbers are out of order in an array. Each pair where a bigger number comes before a smaller one is an inversion.
Analogy: Imagine a line of people by height. Every time a taller person stands before a shorter person, it counts as one inversion, like people not standing in height order.
Array: [2, 4, 1, 3, 5] Inversions: (2,1), (4,1), (4,3) Visual: 2 -> 4 -> 1 -> 3 -> 5 ā ā ā ā ā
