According to the Logic given here, will this not fail if the array is inputted with only negative numbers.
Some Confusion in Logic of 1DP - Maximum Subarray Sum Video
Yes, we can make a special condition easily that if all numbers are negative, return 0 or maximum number as required
Ohk Ohk… Understood. Thanks a lot…
1 Like
Great
You may mark the thread resolved if so. Please give a rating
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.