in problem it explicitly mentioned that implement using Divide and Conquer ( D&C ) technique.
But following D&C implementation show tle.
any optimization will be appreciated.
following is my D&C implementation.
Maximum Subarray Sum (Divide and Conquer)
If all numbers in the array are negative, then output should be the minimum one but your code is giving zero.
i will assign
mxSum = -ve of infinity
Run any test case with all negative values on your code.
Your code is giving zero as the answer.
it work for any type of test cases
but showing tle for large value of n.
Please describe your approach.
Properly documented code and approach described.
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.