Max sum K partition ! quick response needed

Can anyone tell me what is wrong with the code
link: https://ide.codingblocks.com/s/177797
Please make changes in my code and reflect the changes so that i can get what is missing

give me some time i am debugging the code

hi @Codemaniac_Aditya

your code needs a little bit of update, i have made simple so that u can understand
It is just the way it was told in the video
The code link is given below for ur refernce

Sure ,actually i have made some changes in it.

no u`ll have to share the updated code link the udpates wont be available otherwise

i`ll have a look, but u read the updated code as well
its a simple approach
just divide it into k blocks and update each k block
then iterate the block again and update the max_index for that block

yes i got that, actually i had issue with the loop

Still its now showing runtime

just give me 10 minutes , i`ll tell u

try running ur code
for
the following i/p u might encounter the problem
14 3
1 2 5 2 3 4 5 1 2 0 1 5 9 1

its showing 27 in codeblocks while in a offline compiler its showing garbage

19 is the correct output

try a dry run till i debug ur code,

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.