Test case failed here

sample input is giving correct output but testcase failed
code link:ihttps://ide.codingblocks.com/s/102485

Hi Rohan,
Basically you are not calculating the maxsum like for simple array 3 3 your result is only 3.

@mailmeanmolbansal
hlo, i am not able to get what you are saying

Hi Rohan,your code is giving wrong answer for simple input like
TestCase=1
Array size=2
2 2
The answer should be 4 but your code is giving just 2 as max sum.
Try to spend more time your code you will get where you are going wrong.
For better understanding for this problem.
Read Kadanes Algorithm.
Thankyou

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.