This kadene algorithm not working on every test case. Please Help

This algorithm does not give the maximum sub array when the array size is 4 & array elements are 4 -2 -1 -3.

Please provide the program which works on this case.

Hey @Shivam01
Check this https://ide.codingblocks.com/s/347804

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.