def partition(self, A, i, j):
        if i > j:
            raise IndexError
        if i == j:
            return i

        p = i
        ptr_smaller = p
        for ptr in xrange(p + 1, j + 1):  # 1 for loop
            if A[p] < A[ptr]:
                ptr_smaller += 1
                A[ptr], A[ptr_smaller] = A[ptr_smaller], A[ptr]

        A[p], A[ptr_smaller] = A[ptr_smaller], A[p]
        return ptr_smaller
dataset/ETHPy150Open algorhythms/HackerRankAlgorithms/Find the Median.py/Solution.partition/swapped operands of `<`