Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upCreated max_sum_sliding_window in Python/other #3065
Conversation
|
@dhruvmanila @shellhub, Please review it. |
|
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. |
|
There was a bug in the program. I corrected it and added more tests. Now the algorithm works just the way it should. |
|
Also, can you take a look at #3094 ? |


Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}.