Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Defining inversions solution in Clear category for Count Inversions by ale1ster
def count_inversion(sequence):
from itertools import combinations
return sum(a > b for (a, b) in combinations(sequence, 2))
Sept. 3, 2014
Comments: