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
Given an array in which the ith element is the price
of a given stock on day i, what is the maximum profit
can be gained? At most one transation (buy and once
and sell once) is allowed. A stock cannot be sold
before buying it.