Help regarding bottom up implementation of wine problem -dp

how to implement the bottom up solution in cpp??
please help me!!

@sharmalakshyarocks,

dp[l][r] = max profit in selling wine bottles from l to r

Recursive Case:
dp[l][r]=max(dp[l][r-1]+bottle[r]*years_passed,dp[l+1][r]+bottle[l]*years_passed);
Base Case:
dp[l][l]= bottle[l]*years_passed;

where bottle[I]=price of ith bottle.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.