Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximum subarray O(n) solution incorrect #137

Closed
emyarod opened this issue Feb 27, 2018 · 0 comments
Closed

Maximum subarray O(n) solution incorrect #137

emyarod opened this issue Feb 27, 2018 · 0 comments

Comments

@emyarod
Copy link
Contributor

emyarod commented Feb 27, 2018

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant