Best Time to Buy and Sell Stock
#121
Easy
Sliding Window
O(n)
O(1)
Amazon
Facebook
Microsoft
Bloomberg
Goldman Sachs
Problem Description
You are given an array prices where prices[i] is the price of a given stock on the ith day. Find the maximum profit.