Is your feature request related to a problem? Please describe.
Imagine you have a collection of N wines placed next to each other on the shelf. The price of ith wine is pi(Prices of different wines are different). Because wine gets better every year supposing today is year 1, on year y the price would be y*pi i.e y times the value of the initial year. You want to sell all wines but you have to sell one wine per year. One more constraint on each year you are allowed to sell either leftmost or rightmost wine on the shelf. You are not allowed to reorder. You have to find the maximum profit
Describe the solution you'd like
I would like to implement this algorithm using three functions recursion, Top-down DP, bottom-up DP.
Then we can compare the time and space complexity of the above algorithms.
Test Cases:
i/p= [ 2, 3, 5, 1, 4 ]
o/p=50 (max profit)
Please assign me this task.
Thank you.
Is your feature request related to a problem? Please describe.
Imagine you have a collection of N wines placed next to each other on the shelf. The price of ith wine is pi(Prices of different wines are different). Because wine gets better every year supposing today is year 1, on year y the price would be y*pi i.e y times the value of the initial year. You want to sell all wines but you have to sell one wine per year. One more constraint on each year you are allowed to sell either leftmost or rightmost wine on the shelf. You are not allowed to reorder. You have to find the maximum profit
Describe the solution you'd like
I would like to implement this algorithm using three functions recursion, Top-down DP, bottom-up DP.
Then we can compare the time and space complexity of the above algorithms.
Test Cases:
i/p= [ 2, 3, 5, 1, 4 ]
o/p=50 (max profit)
Please assign me this task.
Thank you.