Question: Given an array A [ 1 . . n ] which represents a daily stock price of a particular stock. You are allowed 4 transactions,
Given an array which represents a daily stock price of a particular stock. You are
allowed transactions, buys and sells. Each transaction can involve exactly one stock.
And only one transaction per day is allowed. Give an algorithm to find what is the maximum
profit one can make. For full credits, your algorithm must run in Note: Goldman Sachs
interview question
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
