Kadane algo in subarray

how will kadane algo will work when all no of the array is negative

@royprincejmp If you apply Kadane algo on an array of all negative numbers, it will give you 0 as the answer.
The condition for the Kadane’s Algorithm is that at least one element must be positive. If all elements are negative then the answer is simply the least negative number.