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

fixing expected result for testcase from -9 to -11 to match sliding w… #23

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

Conversation

j2willey
Copy link

This test has the same inputs as in 08-max-subarray-quadratic-test.js
There the expected output is -11
const arr2 = [-2, -5, -3, -1, -11, -7, -6, -4];
const k2 = 4;
expect(maxSubarraySum(arr2, k2)).toBe(-11);

Where as in
10-max-subarray-linear-test.js
const arr2 = [-2, -5, -3, -1, -11, -7, -6, -4];
const k2 = 4;
expect(maxSubarraySum(arr2, k2)).toBe(-9);
the expected output was -9.

-9 would be correct for window size of 3.
For a sliding window of 4 as in the test... -11 should be the expected result.

…indow of 4

(-9 was correct for window size of 3)
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