Created max_sum_sliding_window in Python/other#3065
Merged
dhruvmanila merged 7 commits intoTheAlgorithms:masterfrom Oct 9, 2020
Kush1101:master
Merged
Created max_sum_sliding_window in Python/other#3065dhruvmanila merged 7 commits intoTheAlgorithms:masterfrom Kush1101:master
dhruvmanila merged 7 commits intoTheAlgorithms:masterfrom
Kush1101:master
Conversation
Member
Author
|
@dhruvmanila @shellhub, Please review it. |
dhruvmanila
reviewed
Oct 9, 2020
Member
|
I might be wrong but it seems that this is an incorrect algorithm. As far as I understand you are finding the maximum value from the sum of k consecutive integers in a list of integers which means: >>> arr = [1, 4, 2, 10, 2, 13, 1, 0, 2]
>>> k = 4
>>> max_sum(arr, k) # This should give me 27
16Your algorithm provides 16 as the answer but the answer clearly is 27. Your algorithm is just giving the sum of the last k integers. If so, please test your algorithm thoroughly before submitting. Use black box and white box testing, random tests and especially test the edge cases. |
Member
Author
|
There was a bug in the program. I corrected it and added more tests. Now the algorithm works just the way it should. |
dhruvmanila
requested changes
Oct 9, 2020
Member
|
Also, can you take a look at #3094 ? |
dhruvmanila
approved these changes
Oct 9, 2020
stokhos
pushed a commit
to stokhos/Python
that referenced
this pull request
Jan 3, 2021
* Add files via upload * Update max_sum_sliding_window.py * Update max_sum_sliding_window.py * Update max_sum_sliding_window.py * Added more tests * Update max_sum_sliding_window.py * Update max_sum_sliding_window.py
Panquesito7
pushed a commit
to Panquesito7/Python
that referenced
this pull request
May 13, 2021
* Add files via upload * Update max_sum_sliding_window.py * Update max_sum_sliding_window.py * Update max_sum_sliding_window.py * Added more tests * Update max_sum_sliding_window.py * Update max_sum_sliding_window.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}.