in second case i dont understand how the max subarray sum is 15. please tell me this doubt.
For the second testcase , maximum subarray sum is generated by the subarray {5,10} - 5+10 = 15
in second case i dont understand how the max subarray sum is 15. please tell me this doubt.
For the second testcase , maximum subarray sum is generated by the subarray {5,10} - 5+10 = 15
hello @manoj2597
-10 5 10
this is the array we have.
then subarray made by [5,10] will have maximum sum right?
if we consider -10 as well then then sum will be 5 which is not maximum.
thats why we discarded -10
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.