i have understood the concept
but i need a dp program for this question.
all i could find is programs where the computations are done on the same array
Can i get the code for it
@PoojaSingh22
I didn’t get your doubt. If you want the original array, you can make a copy of that beforehand and then proceed with it.
in the video the concept has been made clear but i need a written program
it just follows the following recurrence:
dp[i][j] = dp[i-1][j] + dp[i][j-1]
you can try to code it yourself. If you face any difficulty feel free to ask it.
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.