Gr-affable
Gr-affable copied to clipboard
Redundant Loop
https://github.com/harpoonix/Gr-affable/blob/3845733a922b0ea0a8cde7bb4b8dd566044a4d07/Symphony/subarray_sum.cpp#L11-L16
We don't need to calculate the sum of the subarray again when the end shifts from j to j+1. We can simply add array[j+1] to the previous sum.
Saves computation.
Raised PR https://github.com/harpoonix/Gr-affable/pull/29