Kadane's algoritm for negative array

what if we have an array with all negative elements. Applying Kadane’s Algorithm we get zero but that isn’t a subarray

hello @Garvit012
yeah in that case kadane fails,
to rectify it initialise ur max_so_far variable with most negative value possible.

and then run kadane