Maximum sum of sub arrays

in this why we take -1 for left and right i.e. for i and j.

Hey @vrcoolbuddy08
because if array is
-1 -2 -3
then for this ans should be 0 and subarray is empty subarray
so to also include this we have don that
if left and right value==-1 then empty subarray is ans

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.