Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
recursive - revisited solution in Clear category for Count Inversions by flpo
def count_inversion(sequence):
if not sequence: return 0
first, *rest = sequence
return sum(x < first for x in rest) + count_inversion(rest)
May 2, 2019