Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
combinations solution in Clear category for Count Inversions by mplichta
from itertools import combinations
def count_inversion(sequence):
return sum(a > b for a, b in combinations(sequence, 2))
March 26, 2018
Comments: