<s> __author__ = "<STR_LIT>" <EOL> def beating_stock ( array ) : <EOL> imin = <NUM_LIT:0> <EOL> deal = [ array [ <NUM_LIT:1> ] - array [ imin ] , imin , <NUM_LIT:1> ] <EOL> for i , d in enumerate ( array ) : <EOL> deal_here = d - array [ imin ] <EOL> if deal_here > deal [ <NUM_LIT:0> ] : <EOL> deal = [ deal_here , imin , i ] <EOL> elif d < array [ imin ] : <EOL> imin = i <EOL> return deal [ <NUM_LIT:0> ] , array [ deal [ <NUM_LIT:1> ] ] , array [ deal [ <NUM_LIT:2> ] ] <EOL> def beating_stock2 ( array ) : <EOL> deal = <NUM_LIT:0> <EOL> min_value = array [ <NUM_LIT:0> ] <EOL> for i , d in enumerate ( array ) : <EOL> deal_here = d - min_value <EOL> if deal_here > deal : <EOL> deal = deal_here <EOL> else : <EOL> if min_value > array [ i ] : <EOL> min_value = array [ i ] <EOL> return deal <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> array = [ <NUM_LIT:7> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:6> , <NUM_LIT:5> , <NUM_LIT:8> , <NUM_LIT:5> , <NUM_LIT:3> , <NUM_LIT:4> ] <EOL> deal = beating_stock ( array ) <EOL> print ( "<STR_LIT>" % ( deal [ <NUM_LIT:0> ] , deal [ <NUM_LIT:1> ] , deal [ <NUM_LIT:2> ] ) ) <EOL> deal = beating_stock2 ( array ) <EOL> print "<STR_LIT>" + str ( deal ) </s>
