def beating_stock(array):

    imin = 0

    # first deal is just buying in the next day (1)
    deal = [array[1] - array[imin], imin, 1]

    for i, d in enumerate(array):

        deal_here = d - array[imin]

        if deal[0] > deal_here:
            deal = [deal_here, imin, i]

        elif d < array[imin]:
            imin = i

    return deal[0], array[deal[1]], array[deal[2]]
dataset/ETHPy150Open bt3gl/Python-and-Algorithms-and-Data-Structures/src/builtin_structures/max_subarray_stocks.py/beating_stock/swapped operands of `>`