why are we adding sum[i][j] please help
Can you please explain me the need for sum[][]
hi @chemant077,
let me answer your first question, we are adding sum[i][j] to include the cost occurred while joining slimes in the range i to j .
you are getting wrong answer because , you are providing wrong range to the function,
you are calling fa(0, n); but it should be fa(0, n-1); as when you are accessing sum[0][n] it accesses uninitialized value, which is 0 as sum declared as global ,
corrected code :- https://ide.codingblocks.com/s/263206
In case of any doubt feel free to ask 
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.