• + 1 comment
    def larrysArray(A):
        count = 0
        
        for i in range(len(A)):
            for j in range(i+1, len(A)):
                if A[i] > A[j]:
                    count += 1
        
        return 'YES' if count % 2 == 0 else 'NO'