Skip to content

Maximum subarray O(n) solution incorrect #137

@emyarod

Description

@emyarod

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions