Best time to buy and sell stock
Given daily prices, return the most profit you can make. First allow any number of buy-then-sell transactions (holding one share at a time), then allow only one transaction.
No answer yet. Write the first one; the best answer gets endorsed.
