One passEasy
Best Time to Buy and Sell Stock
Given a price for each day, find the biggest profit from buying on one day and selling on a later one, or 0 if no sale earns anything.
One passEasy
Given a price for each day, find the biggest profit from buying on one day and selling on a later one, or 0 if no sale earns anything.