Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
1-liner: basically each substring is enumerated solution in Clear category for Count Inversions by Stensen
count_inversion = lambda seq: sum( b < a for i, a in enumerate(seq) for b in seq[i+1:])
Nov. 16, 2020
Comments: