Maximum sum subarray

Prateek bhaiya has not discussed the case if all elements are negative…so if all nos are negative then our ans will be zero which is wrong??
correct me if i am wrong…

@Shobhit_kumar yes kadane fails for all neg case but you can easily check all negative case separately just print the maximum element

okay thank u so much