Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Count Inversions by michael.kej
def count_inversion(sequence):
counted = 0
for s in range(len(sequence)):
for i in range(s+1, len(sequence)):
if sequence[s] > sequence[i]:
counted += 1
return counted
Oct. 11, 2014
Comments: