You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Problem: You are given an array where prices[i] is the price of a given stock on the i-th day. You want to maximize your profit by choosing a single day to buy and a single day to sell. You cannot sell before you buy.