Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Count Inversions by sebastian.okseniuk
def count_inversion(sequence):
nowaLista = len(sequence)
print(nowaLista)
print(sequence)
wynik = 0
for i in range(0, nowaLista -1):
for j in range(1 + i, nowaLista):
if sequence[i]> sequence[j]:
wynik += 1
print(wynik)
return wynik
Dec. 2, 2015