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

Adjust test where all items are negative #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

daniel-dawson
Copy link

@daniel-dawson daniel-dawson commented Jun 21, 2020

Change the expected solution of the test when all items are negative to
equal the maximum element. In the case of the provided array, the answer
would be -1. This aligns with how the question is phrased, and is often
represented on algorithm sites.

Also change the input array so that the maximum element is a middle
element. This accounts for solutions that set the initial maximum to the
first element of the input array.

An alternate solution would be to change the wording of the problem to
only allow for sums above or equal to zero.

#4

Change the expected solution of the test when all items are negative to
equal the maximum element. In the case of the provided array, the answer
would be -1. This aligns with how the question is phrased, and is often
represented on algorithm sites.

Also change the input array so that the maximum element is a middle
element. This accounts for solutions that set the initial maximum to the
first element of the input array.

An alternate solution would be to change the wording of the problem to
only allow for sums above or equal to zero.
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

Successfully merging this pull request may close these issues.

1 participant