LeetCode
K Inverse Pairs Array
Click
here
for an explanation.