since the sum is a constant i can calculate it in the main and then while printing the ans add the sum to it…but i am not getting the correct output…can u please check the code and guide me
Can i calculate the sum in the main
@PoojaSingh22 see the video whole at the last it shown sum is 2d array storing from i to j . preprocess function is used for that. you cant just add it in last it doesn’t make any sense . see the video once again you will get it.
dont forget to hit like and mark resolved if cleared 
see sum[m][n] is going to give the sum of the entire array…and according to the video also the last two slimes when added will give the height of the last slime+ we have to add the sum to it…so where m i getting wrong
@PoojaSingh22 we are adding sum[i][j] recursively in the function so we are adding many times in the subproblems so how can you just add the whole sum in last to get the answer .
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.