This program is not working on every test case. Please Help

In this program if only 1st element in the array is the greatest sub array then the output is wrong.

Please explain that logic.

Hey @Shivam01
Yes we have to add one constraint which Sir missed
Please refer to this code https://ide.codingblocks.com/s/328751?_ga=2.157135099.1350203873.1600106484-1795954092.1597348154

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.