Maximum sub array sum

is whole array also a sub array,
like if I enter all elements positive then sum will be of whole array or not?

@Bansaljatin05 Yes the whole array is also considered as a subarray. So if you enter all positive elements then maximum subarray sum will be the sum of all elements.
Hope this helps :slightly_smiling_face:

1 Like