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 waiting by height. Every time a taller person stands before a shorter one, it counts as a mix-up or inversion.
Array: [2, 4, 1, 3, 5] Indices: 0 1 2 3 4 Inversions: pairs like (2,1), (4,1), (4,3)
