dmjio
10/9/2012 - 9:22 PM

Inversion finder

Inversion finder

def invFinder(a): #O(n^2) :-/
        list = []
        for i,j in enumerate(a):
                for k,l in enumerate(a):
                        if i < k and j > l:
                                list.append((j,l,))
        return list