Maximum subarray O(n) solution incorrect
emyarod opened this issue · 0 comments
emyarod commented
The current implementation will fail the following tests:
maxSubarray([]); // returns 0, should return `undefined`
maxSubarray([-42]); // returns 0, should return 42
maxSubArray([-10, -1, -2, -3, -1]); // returns 0, should return -1