The cost of stock on each day is given in an array A[] of size N. Find all the days on which you buy and sell the stock so that in between those days your profit is maximum.
- Time : O(n)
- Space : O(n)
1 | void stockBuySell(int A[], int n) { |
The cost of stock on each day is given in an array A[] of size N. Find all the days on which you buy and sell the stock so that in between those days your profit is maximum.
1 | void stockBuySell(int A[], int n) { |