Wrong o/p for i/p int arr[] = {0,2,-1,4,5,-7,6};

for i/p int arr[] = {0,2,-1,4,5,-7,6};
and n=7
o/p= 0 2 -1 4 5
although this 0 can be eliminated by checking if sum>=max_sum (correction)
Is there any other way to find this w/o adding 0 in beginning