DSA Key Problems

Best Time to Buy and Sell Stock

Given daily stock prices, return the greatest profit obtainable by buying once and selling once on a later day, or zero if no profitable trade exists.