Design a Stack class that supports push, pop, and findMax in O(1) time. Also, given an array of stock prices, find the maximum profit from one buy and one sell transaction.
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.