st0le
8/30/2014 - 5:06 AM

Inversion Count - Using Naive Algorithm

Inversion Count - Using Naive Algorithm

def inversionCount_1(A):
    c = 0
    for i in xrange(len(A)):
        for j in xrange(i + 1,len(A)):
            if A[i] > A[j]: 
                c += 1
    return c