Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Count Inversions by OrginalS
def count_inversion(sequence):
res = 0
for i in range(len(sequence)):
for element in sequence[i:]:
res += element < sequence[i]
return res
Oct. 16, 2019