LeetCode
Global and Local Inversions
Click
here
for an explanation.